diff --git a/header.go b/header.go index d31da8d..3c94f7d 100644 --- a/header.go +++ b/header.go @@ -1,14 +1,16 @@ package req import ( - "github.com/imroc/req/v3/internal/header" - "golang.org/x/net/http/httpguts" "io" "net/http" "net/textproto" "sort" "strings" "sync" + + "golang.org/x/net/http/httpguts" + + "github.com/imroc/req/v3/internal/header" ) var headerNewlineToSpace = strings.NewReplacer("\n", " ", "\r", " ") diff --git a/http_request.go b/http_request.go index c737a6b..5816de4 100644 --- a/http_request.go +++ b/http_request.go @@ -2,11 +2,13 @@ package req import ( "errors" - "github.com/imroc/req/v3/internal/ascii" - "github.com/imroc/req/v3/internal/header" - "golang.org/x/net/http/httpguts" "net/http" "strings" + + "golang.org/x/net/http/httpguts" + + "github.com/imroc/req/v3/internal/ascii" + "github.com/imroc/req/v3/internal/header" ) // Given a string of the form "host", "host:port", or "[ipv6::address]:port", @@ -88,12 +90,13 @@ func closeRequestBody(r *http.Request) error { // Headers that Request.Write handles itself and should be skipped. var reqWriteExcludeHeader = map[string]bool{ - "Host": true, // not in Header map anyway - "User-Agent": true, - "Content-Length": true, - "Transfer-Encoding": true, - "Trailer": true, - header.HeaderOderKey: true, + "Host": true, // not in Header map anyway + "User-Agent": true, + "Content-Length": true, + "Transfer-Encoding": true, + "Trailer": true, + header.HeaderOderKey: true, + header.PseudoHeaderOderKey: true, } // requestMethodUsuallyLacksBody reports whether the given request