Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: http2 transport doesn't send a default User-Agent #13685

Closed
bradfitz opened this issue Dec 18, 2015 · 6 comments
Closed

net/http: http2 transport doesn't send a default User-Agent #13685

bradfitz opened this issue Dec 18, 2015 · 6 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

The Go http2 client doesn't send a default User-Agent header like the http1 client.

/cc @bmizerany

@bradfitz bradfitz self-assigned this Dec 18, 2015
@bradfitz bradfitz added this to the Go1.6 milestone Dec 18, 2015
@gopherbot
Copy link

CL https://golang.org/cl/18033 mentions this issue.

@rakyll
Copy link
Contributor

rakyll commented Dec 23, 2015

@bradfitz, could we append the default agent even if User-Agent is set? This allows us to see traffic metrics related to clients written in Go.

@minux
Copy link
Member

minux commented Dec 23, 2015

I don't like always appending the default user-agent.
If the user specifies the user agent, it must be for a
reason, and Go should respect that.

And note that we turned down one previous attempt
for sending the exact Go runtime.Version in the default
user agent for similar reasons.

@rakyll
Copy link
Contributor

rakyll commented Dec 23, 2015

I agree that client code must be able to override.

I'd be happy if we were allowing users to append to the default if they'd like to. But there are numerous ways to construct a Request instance (including the zero-value Request) and setting the default user agent during construction is not an option.

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 6, 2016

@rakyll, let's move that planning into #13837

This bug is just about http2 feature and behavior parity with http1 for Go 1.6.

@gopherbot
Copy link

CL https://golang.org/cl/18284 mentions this issue.

bradfitz added a commit to golang/net that referenced this issue Jan 6, 2016
Tests in main repo, named:

=== RUN   TestTransportUserAgent_h1
--- PASS: TestTransportUserAgent_h1 (0.00s)
=== RUN   TestTransportUserAgent_h2
--- PASS: TestTransportUserAgent_h2 (0.03s)

(in upcoming CL)

Updates golang/go#13685

Change-Id: I2b62489eb03b7ff791f1f6ae6dc9c4e4f6895d39
Reviewed-on: https://go-review.googlesource.com/18285
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Jan 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants