Use Header.Set() to override the existing header value (#1032)

Header.Add() appends string if there are same header key exists. Use Header.Set() to prevent this.
This commit is contained in:
Ta-Ching Chen
2018-12-20 17:23:26 +08:00
committed by GitHub
parent e50fd3e30c
commit 701b2b26ad
9 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ func (p *WebhookPublisher) makeHttpRequest(r *publishRequest) {
// Create request
req, err := http.NewRequest("POST", url, &buf)
for k, v := range r.headers {
req.Header.Add(k, v)
req.Header.Set(k, v)
}
// Make the request