Skip to content

Commit

Permalink
feat(enhancement)!: by default do not set request 'Accept' header #643 (
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm authored Nov 12, 2024
1 parent c37c318 commit 9e0e070
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
7 changes: 0 additions & 7 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,6 @@ func parseRequestHeader(c *Client, r *Request) error {
r.Header.Set(hdrUserAgentKey, hdrUserAgentValue)
}

if !r.isHeaderExists(hdrAcceptKey) {
ct := r.Header.Get(hdrContentTypeKey)
if isJSONContentType(ct) || isXMLContentType(ct) {
r.Header.Set(hdrAcceptKey, ct)
}
}

if !r.isHeaderExists(hdrAcceptEncodingKey) {
r.Header.Set(hdrAcceptEncodingKey, r.client.ContentDecompressorKeys())
}
Expand Down
1 change: 0 additions & 1 deletion middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ func Test_parseRequestHeader(t *testing.T) {
},
expectedHeader: http.Header{
hdrContentTypeKey: []string{"application/json"},
hdrAcceptKey: []string{"application/json"},
hdrUserAgentKey: []string{hdrUserAgentValue},
},
},
Expand Down

0 comments on commit 9e0e070

Please sign in to comment.