mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-09 19:18:06 -06:00
[chore] Set User-Agent header in transport (#1154)
Currently requests set their own User-Agent. This moves it down to set it in the transport's do() method, to guarantee it's always set on all requests.
This commit is contained in:
parent
d6f4d196c9
commit
c5ae88c51b
6 changed files with 2 additions and 7 deletions
|
|
@ -134,6 +134,8 @@ func (t *transport) do(r *http.Request, signer func(*http.Request) error, retryO
|
|||
{"url", r.URL.String()},
|
||||
}...)
|
||||
|
||||
r.Header.Set("User-Agent", t.controller.userAgent)
|
||||
|
||||
for i := 0; i < maxRetries; i++ {
|
||||
// Reset signing header fields
|
||||
now := t.controller.clock.Now().UTC()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue