mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:42:24 -05: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
|
|
@ -93,7 +93,6 @@ func dereferenceByAPIV1Instance(ctx context.Context, t *transport, iri *url.URL)
|
|||
}
|
||||
|
||||
req.Header.Add("Accept", string(api.AppJSON))
|
||||
req.Header.Add("User-Agent", t.controller.userAgent)
|
||||
req.Header.Set("Host", cleanIRI.Host)
|
||||
|
||||
resp, err := t.GET(req)
|
||||
|
|
@ -244,7 +243,6 @@ func callNodeInfoWellKnown(ctx context.Context, t *transport, iri *url.URL) (*ur
|
|||
return nil, err
|
||||
}
|
||||
req.Header.Add("Accept", string(api.AppJSON))
|
||||
req.Header.Add("User-Agent", t.controller.userAgent)
|
||||
req.Header.Set("Host", cleanIRI.Host)
|
||||
|
||||
resp, err := t.GET(req)
|
||||
|
|
@ -296,7 +294,6 @@ func callNodeInfo(ctx context.Context, t *transport, iri *url.URL) (*apimodel.No
|
|||
return nil, err
|
||||
}
|
||||
req.Header.Add("Accept", string(api.AppJSON))
|
||||
req.Header.Add("User-Agent", t.controller.userAgent)
|
||||
req.Header.Set("Host", iri.Host)
|
||||
|
||||
resp, err := t.GET(req)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue