Skip to content

Commit

Permalink
copy User-Agent from DEP request to auth/session request (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson authored Mar 13, 2024
1 parent 155fd5d commit 4c207e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
sessionURL.String(),
nil,
)
if userAgent := req.Header.Get("User-Agent"); userAgent != "" {
// copy the UA from the original request to the auth request
sessionReq.Header.Set("User-Agent", userAgent)
}
if err != nil {
return nil, fmt.Errorf("transport: creating session request: %w", err)
}
Expand Down

0 comments on commit 4c207e8

Please sign in to comment.