Skip to content

Commit

Permalink
fix: add noDefaultContentType copy (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jin-gou committed Apr 14, 2023
1 parent d76662b commit 43cc487
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions header.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ func (h *RequestHeader) CopyTo(dst *RequestHeader) {
dst.disableNormalizing = h.disableNormalizing
dst.noHTTP11 = h.noHTTP11
dst.connectionClose = h.connectionClose
dst.noDefaultContentType = h.noDefaultContentType

dst.contentLength = h.contentLength
dst.contentLengthBytes = append(dst.contentLengthBytes, h.contentLengthBytes...)
Expand Down
1 change: 1 addition & 0 deletions header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ func TestRequestHeaderCopyTo(t *testing.T) {
h.Set(HeaderHost, "aaaa")
h.Set("aaaxxx", "123")
h.Set(HeaderTrailer, "foo, bar")
h.noDefaultContentType = true

var h1 RequestHeader
h.CopyTo(&h1)
Expand Down

0 comments on commit 43cc487

Please sign in to comment.