Skip to content

Commit 9e0e070

Browse files
authored
feat(enhancement)!: by default do not set request 'Accept' header #643 (#908)
1 parent c37c318 commit 9e0e070

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

middleware.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,6 @@ func parseRequestHeader(c *Client, r *Request) error {
220220
r.Header.Set(hdrUserAgentKey, hdrUserAgentValue)
221221
}
222222

223-
if !r.isHeaderExists(hdrAcceptKey) {
224-
ct := r.Header.Get(hdrContentTypeKey)
225-
if isJSONContentType(ct) || isXMLContentType(ct) {
226-
r.Header.Set(hdrAcceptKey, ct)
227-
}
228-
}
229-
230223
if !r.isHeaderExists(hdrAcceptEncodingKey) {
231224
r.Header.Set(hdrAcceptEncodingKey, r.client.ContentDecompressorKeys())
232225
}

middleware_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ func Test_parseRequestHeader(t *testing.T) {
469469
},
470470
expectedHeader: http.Header{
471471
hdrContentTypeKey: []string{"application/json"},
472-
hdrAcceptKey: []string{"application/json"},
473472
hdrUserAgentKey: []string{hdrUserAgentValue},
474473
},
475474
},

0 commit comments

Comments
 (0)