fix: add noDefaultContentType copy (#1538)

This commit is contained in:
kinggo
2023-04-14 16:38:32 +08:00
committed by GitHub
parent d76662b46d
commit 43cc4870e6
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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...)
+1
View File
@@ -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)