Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: http2 transport doesn't send a default User-Agent #13685
I don't like always appending the default user-agent.
And note that we turned down one previous attempt
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.
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 <firstname.lastname@example.org>