]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] 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)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 14 Oct 2019 18:28:36 +0000 (18:28 +0000)
commit2018d431c7e865d6db909cc0aa0d1f6d01e54583
treef1011e33038e6cb23c1d53df52b00bd325c879cd
parent49073c579e02ad97a1c3e0b645c4cac1a3622fb6
[release-branch.go1.13] 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 #34882

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>
(cherry picked from commit 9969c720800302c63147720da5507633133bd4a6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/201040
src/net/http/client.go
src/net/http/clone.go
src/net/http/header_test.go
src/net/http/request_test.go