From 5027d0ced25f06c12208cd618cfbb83518610d79 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 4 May 2023 12:28:50 +0200 Subject: [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 --- internal/transport/finger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/transport') 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 -- cgit v1.3