internal/http3: include minor HTTP version in default User-Agent header HTTP/1 and HTTP/2 transports include the minor version in their default User-Agent header. Do so for HTTP/3 too for consistency. For golang/go#70914 Change-Id: I750bf9a21bef28594262c33349940d856a6a6964 Reviewed-on: https://go-review.googlesource.com/c/net/+/817121 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com>
diff --git a/internal/http3/roundtrip.go b/internal/http3/roundtrip.go index c5aab72..46afe67 100644 --- a/internal/http3/roundtrip.go +++ b/internal/http3/roundtrip.go
@@ -143,7 +143,7 @@ }, AddGzipHeader: addedGzip, PeerMaxHeaderListSize: 0, - DefaultUserAgent: "Go-http-client/3", + DefaultUserAgent: "Go-http-client/3.0", }, func(name, value string) { // Issue #71374: Consider supporting never-indexed fields. yield(mayIndex, name, value)
diff --git a/internal/http3/roundtrip_test.go b/internal/http3/roundtrip_test.go index 2ca08ae..814233b 100644 --- a/internal/http3/roundtrip_test.go +++ b/internal/http3/roundtrip_test.go
@@ -902,7 +902,7 @@ ":method": []string{"GET"}, ":path": []string{"/"}, ":scheme": []string{"https"}, - "User-Agent": []string{"Go-http-client/3"}, + "User-Agent": []string{"Go-http-client/3.0"}, } tt.setup(tc, req, wantHeaders) tc.greet()