Merge branch 'well-known' into 'develop'

NodeInfo: Accept application/activity+json requests

See merge request pleroma/pleroma!4242
This commit is contained in:
feld 2024-09-06 16:30:07 +00:00 committed by Haelwenn (lanodan) Monnier
parent ced6b10c70
commit 2977779e94
No known key found for this signature in database
3 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1 @@
Accept application/activity+json for requests to .well-known/nodeinfo

View file

@ -189,7 +189,7 @@ defmodule Pleroma.Web.Router do
end
pipeline :well_known do
plug(:accepts, ["json", "jrd", "jrd+json", "xml", "xrd+xml"])
plug(:accepts, ["activity+json", "json", "jrd", "jrd+json", "xml", "xrd+xml"])
end
pipeline :config do

View file

@ -24,6 +24,19 @@ defmodule Pleroma.Web.NodeInfoTest do
|> get(href)
|> json_response(200)
end)
accept_types = [
"application/activity+json",
"application/json",
"application/jrd+json"
]
for type <- accept_types do
conn
|> put_req_header("accept", type)
|> get("/.well-known/nodeinfo")
|> json_response(200)
end
end
test "nodeinfo shows staff accounts", %{conn: conn} do