-
Brad Fitzpatrick authored
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>
194a5c3e