[GO] dont canonize headers (#10779)

* [GO]: dont canonize headers

* [GO]: update unit tests
This commit is contained in:
Andrew 2021-11-14 05:36:49 +03:00 committed by GitHub
parent 552a31d85c
commit d91ff3a150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View File

@ -316,7 +316,7 @@ func (c *APIClient) prepareRequest(
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
headers[h] = []string{v}
}
localVarRequest.Header = headers
}

View File

@ -151,7 +151,7 @@ func TestAPIKeyNoPrefix(t *testing.T) {
}
reqb, _ := httputil.DumpRequest(r.Request, true)
if !strings.Contains((string)(reqb), "Api_key: TEST123") {
if !strings.Contains((string)(reqb), "api_key: TEST123") {
t.Errorf("APIKey Authentication is missing")
}
@ -186,7 +186,7 @@ func TestAPIKeyWithPrefix(t *testing.T) {
}
reqb, _ := httputil.DumpRequest(r.Request, true)
if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") {
if !strings.Contains((string)(reqb), "api_key: Bearer TEST123") {
t.Errorf("APIKey Authentication is missing")
}

View File

@ -324,7 +324,7 @@ func (c *APIClient) prepareRequest(
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
headers[h] = []string{v}
}
localVarRequest.Header = headers
}

View File

@ -309,7 +309,7 @@ func (c *APIClient) prepareRequest(
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
headers[h] = []string{v}
}
localVarRequest.Header = headers
}

View File

@ -151,7 +151,7 @@ func TestAPIKeyNoPrefix(t *testing.T) {
}
reqb, _ := httputil.DumpRequest(r.Request, true)
if !strings.Contains((string)(reqb), "Api_key: TEST123") {
if !strings.Contains((string)(reqb), "api_key: TEST123") {
t.Errorf("APIKey Authentication is missing")
}
@ -186,7 +186,7 @@ func TestAPIKeyWithPrefix(t *testing.T) {
}
reqb, _ := httputil.DumpRequest(r.Request, true)
if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") {
if !strings.Contains((string)(reqb), "api_key: Bearer TEST123") {
t.Errorf("APIKey Authentication is missing")
}

View File

@ -327,7 +327,7 @@ func (c *APIClient) prepareRequest(
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
headers[h] = []string{v}
}
localVarRequest.Header = headers
}