]> Cypherpunks repositories - gostls13.git/commit
net/http: fix Transport panic with nil Request.Header
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Sun, 13 Oct 2019 22:07:06 +0000 (15:07 -0700)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Mon, 14 Oct 2019 17:53:36 +0000 (17:53 +0000)
commit9969c720800302c63147720da5507633133bd4a6
treeaf45c6920f24ee26fc0b5931c020c2de0d706d2b
parentdab199c9c10717bd134edacdfddf084b9295b1b7
net/http: fix Transport panic with nil Request.Header

For Go 1.13 we introduced Header.Clone and it returns
nil if a nil Header is cloned. Unfortunately, though,
this exported Header.Clone nil behavior differed from
the old Go 1.12 and earlier internal header clone
behavior which always returned non-nil Headers.
This CL fixes the places where that distinction mattered.

Fixes #34878

Change-Id: Id19dea2272948c8dd10883b18ea7f7b8b33ea8eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/200977
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/client.go
src/net/http/clone.go
src/net/http/header_test.go
src/net/http/request_test.go