mirror of
1
Fork 0

fix: respond with JSON Resource Descriptor Content-Type per RFC7033

This commit is contained in:
Aravinth Manivannan 2024-04-02 14:11:47 +05:30
parent a2f603dedd
commit 2c2f146895
No known key found for this signature in database
GPG Key ID: F8F50389936984FF
2 changed files with 2 additions and 0 deletions

View File

@ -118,4 +118,5 @@ func WebfingerQuery(ctx *context.Context) {
Aliases: aliases,
Links: links,
})
ctx.Resp.Header().Set("Content-Type", "application/jrd+json")
}

View File

@ -48,6 +48,7 @@ func TestWebfinger(t *testing.T) {
req := NewRequest(t, "GET", fmt.Sprintf("/.well-known/webfinger?resource=acct:%s@%s", user.LowerName, appURL.Host))
resp := MakeRequest(t, req, http.StatusOK)
assert.Equal(t, resp.Header().Get("Content-Type"), "application/jrd+json")
var jrd webfingerJRD
DecodeJSON(t, resp, &jrd)