-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: figure out a better User-Agent story #13837
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
Comments
I don't know why we may like to handle it in the Transport layer. Can we have a setter and an appender on *Request?
AppendUserAgent appends to the old user agent. If old user agent is empty, it appends to the default UA. |
To be honest, I don't see the big downside in the status quo. What problem are we trying to solve? |
Too late for Go 1.7 anyway. |
The problem here is there are too many RoundTripper wrapper implementations which just set or append User-Agents. Somebody should do an audit (including those inside gocloud) here in this bug before anything happens, though. Maybe it's not as bad as I remember. |
@bradfitz roll into 'new HTTP client API' issue? |
Closing, folding into #23707. |
Fork of some discussion in #13685
Let's figure out User-Agents in Go 1.7: perhaps an optional func field on http1 and http2 Transports to modify the User-Agent before it's sent out?
Or fields for the default value to set if unset? Or a field to append? Maybe those are the two common requests.
In any case, the stdlib's private http2 Transport should use the public http1.Transport's same options, and this should all have new clientserver_test.go additions similar to https://go-review.googlesource.com/18284
/cc @okdave @rakyll @adg
The text was updated successfully, but these errors were encountered: