Skip to content

Commit

Permalink
add user-agent for proxy tracking
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmet Alp Balkan <[email protected]>
  • Loading branch information
ahmetb committed Oct 7, 2020
1 parent c770d6b commit 1052b6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runsd/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ func (a authenticatingTransport) RoundTrip(req *http.Request) (*http.Response, e
if req.Header.Get("authorization") == "" {
req.Header.Set("authorization", "Bearer "+idToken)
}
ua := req.Header.Get("user-agent")
req.Header.Set("user-agent", fmt.Sprintf("runsd version=%s", version))
if ua != "" {
req.Header.Set("user-agent", req.Header.Get("user-agent")+"; "+ua)
}
return a.next.RoundTrip(req)
}

Expand Down

0 comments on commit 1052b6e

Please sign in to comment.