Chore: Use Header.Set method instead of Header.Add (#29804)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-14 15:13:01 +01:00
committed by GitHub
parent ebb8b4286b
commit ac09baae7d
11 changed files with 30 additions and 28 deletions
+2 -2
View File
@@ -114,8 +114,8 @@ func (provider *accessTokenProvider) getAccessToken(data templateData) (string,
}
getTokenReq, _ := http.NewRequest("POST", urlInterpolated, bytes.NewBufferString(params.Encode()))
getTokenReq.Header.Add("Content-Type", "application/x-www-form-urlencoded")
getTokenReq.Header.Add("Content-Length", strconv.Itoa(len(params.Encode())))
getTokenReq.Header.Set("Content-Type", "application/x-www-form-urlencoded")
getTokenReq.Header.Set("Content-Length", strconv.Itoa(len(params.Encode())))
resp, err := client.Do(getTokenReq)
if err != nil {