mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-11-14 04:52:17 +00:00
NodeInfo: Accept application/activity+json requests
This commit is contained in:
parent
62856ab18f
commit
4ae17c6294
3 changed files with 15 additions and 1 deletions
1
changelog.d/well-known.change
Normal file
1
changelog.d/well-known.change
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Accept application/activity+json for requests to .well-known/nodeinfo
|
|
@ -189,7 +189,7 @@ defmodule Pleroma.Web.Router do
|
||||||
end
|
end
|
||||||
|
|
||||||
pipeline :well_known do
|
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
|
end
|
||||||
|
|
||||||
pipeline :config do
|
pipeline :config do
|
||||||
|
|
|
@ -24,6 +24,19 @@ defmodule Pleroma.Web.NodeInfoTest do
|
||||||
|> get(href)
|
|> get(href)
|
||||||
|> json_response(200)
|
|> json_response(200)
|
||||||
end)
|
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
|
end
|
||||||
|
|
||||||
test "nodeinfo shows staff accounts", %{conn: conn} do
|
test "nodeinfo shows staff accounts", %{conn: conn} do
|
||||||
|
|
Loading…
Reference in a new issue