From 43cc4870e6bf99ea276867a145aad56e18b6417d Mon Sep 17 00:00:00 2001 From: kinggo Date: Fri, 14 Apr 2023 16:38:32 +0800 Subject: [PATCH] fix: add noDefaultContentType copy (#1538) --- header.go | 1 + header_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/header.go b/header.go index 8804204c3c..76b7d35eb0 100644 --- a/header.go +++ b/header.go @@ -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...) diff --git a/header_test.go b/header_test.go index 9dfd64c631..94eee8b244 100644 --- a/header_test.go +++ b/header_test.go @@ -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)