]> Cypherpunks repositories - gostls13.git/commit
net/http: update bundled http2, add test for Transport's User-Agent behavior
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 6 Jan 2016 07:14:49 +0000 (07:14 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 6 Jan 2016 18:53:46 +0000 (18:53 +0000)
commit194a5c3e61d4509bdc9c84005305a881783939e3
tree0e812289756bbe8b82959d3e7c27aa2ea2d790e5
parenta4f10bddc3013809e91212c43761688481ac352e
net/http: update bundled http2, add test for Transport's User-Agent behavior

Adds a test that both http1 and http2's Transport send a default
User-Agent, with the same behavior.

Updates bundled http2 to golang.org/x/net git rev 1ade16a545 (for
https://go-review.googlesource.com/18285)

The http1 behavior changes slightly: if req.Header["User-Agent"] is
defined at all, even if it's nil or a zero-length slice, then the
User-Agent header is omitted. This is a slight behavior change for
http1, but is consistent with how http1 & http2 do optional headers
elsewhere (such as "Date", "Content-Type"). The old behavior (set it
explicitly to "", aka []string{""}) still works as before. And now
there are even tests.

Fixes #13685

Change-Id: I5786a6913b560de4a5f1f90e595fe320ff567adf
Reviewed-on: https://go-review.googlesource.com/18284
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/clientserver_test.go
src/net/http/h2_bundle.go
src/net/http/request.go