mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-29 05:06:11 +01:00
fix: respond with JSON Resource Descriptor Content-Type per RFC7033
This commit is contained in:
parent
71153ef8b4
commit
e13854c305
|
@ -118,4 +118,5 @@ func WebfingerQuery(ctx *context.Context) {
|
||||||
Aliases: aliases,
|
Aliases: aliases,
|
||||||
Links: links,
|
Links: links,
|
||||||
})
|
})
|
||||||
|
ctx.Resp.Header().Set("Content-Type", "application/jrd+json")
|
||||||
}
|
}
|
||||||
|
|
|
@ -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))
|
req := NewRequest(t, "GET", fmt.Sprintf("/.well-known/webfinger?resource=acct:%s@%s", user.LowerName, appURL.Host))
|
||||||
resp := MakeRequest(t, req, http.StatusOK)
|
resp := MakeRequest(t, req, http.StatusOK)
|
||||||
|
assert.Equal(t, resp.Header().Get("Content-Type"), "application/jrd+json")
|
||||||
|
|
||||||
var jrd webfingerJRD
|
var jrd webfingerJRD
|
||||||
DecodeJSON(t, resp, &jrd)
|
DecodeJSON(t, resp, &jrd)
|
||||||
|
|
Loading…
Reference in a new issue