commit: 2977779e94cb34610d0c2369ecacf7d721ebc5ab
parent ced6b10c70769e39ee7d3b6a3fe63b8c2aea3ec0
Author: feld <feld@feld.me>
Date: Fri, 6 Sep 2024 16:30:07 +0000
Merge branch 'well-known' into 'develop'
NodeInfo: Accept application/activity+json requests
See merge request pleroma/pleroma!4242
Diffstat:
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/changelog.d/well-known.change b/changelog.d/well-known.change
@@ -0,0 +1 @@
+Accept application/activity+json for requests to .well-known/nodeinfo
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
@@ -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
diff --git a/test/pleroma/web/node_info_test.exs b/test/pleroma/web/node_info_test.exs
@@ -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