Skip to content

Commit 10cb1ef

Browse files
authored
fix(transport/http): Add user agent to request headers (#3050)
Fixes #3049
1 parent 0f2af0f commit 10cb1ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

transport/http/dial.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal.
105105
if ds.RequestReason != "" {
106106
headers.Set("X-goog-request-reason", ds.RequestReason)
107107
}
108+
if ds.UserAgent != "" {
109+
headers.Set("User-Agent", ds.UserAgent)
110+
}
108111
client, err := httptransport.NewClient(&httptransport.Options{
109112
DisableTelemetry: ds.TelemetryDisabled,
110113
DisableAuthentication: ds.NoAuth,

0 commit comments

Comments
 (0)