diff options
| author | 2023-05-04 12:28:50 +0200 | |
|---|---|---|
| committer | 2023-05-04 12:28:50 +0200 | |
| commit | 5027d0ced25f06c12208cd618cfbb83518610d79 (patch) | |
| tree | 5e215da7d4e6eaa5f8be7e1eead39b63b3037847 /internal/transport | |
| parent | [bugfix] Rework notifs to use min_id for paging up (#1734) (diff) | |
| download | gotosocial-5027d0ced25f06c12208cd618cfbb83518610d79.tar.xz | |
[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
Diffstat (limited to 'internal/transport')
| -rw-r--r-- | internal/transport/finger.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/transport/finger.go b/internal/transport/finger.go index 4c3cacd7d..f106019b5 100644 --- a/internal/transport/finger.go +++ b/internal/transport/finger.go @@ -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 |
