mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 16:08:07 -06:00
[bugfix] Serve correct 'application/jrd+json' content type for webfinger requests (#1738)
* [bugfix] Return `application/jrd+json` from webfinger queries * update finger req content-type
This commit is contained in:
parent
4a012acd52
commit
5027d0ced2
7 changed files with 128 additions and 161 deletions
|
|
@ -59,8 +59,10 @@ func prepWebfingerReq(ctx context.Context, loc, domain, username string) (*http.
|
|||
value := url.QueryEscape("acct:" + username + "@" + domain)
|
||||
req.URL.RawQuery = "resource=" + value
|
||||
|
||||
// Prefer application/jrd+json, fall back to application/json.
|
||||
// See https://www.rfc-editor.org/rfc/rfc7033#section-10.2.
|
||||
req.Header.Add("Accept", string(apiutil.AppJRDJSON))
|
||||
req.Header.Add("Accept", string(apiutil.AppJSON))
|
||||
req.Header.Add("Accept", "application/jrd+json")
|
||||
req.Header.Set("Host", req.URL.Host)
|
||||
|
||||
return req, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue