diff options
author | Mark Felder <feld@feld.me> | 2024-08-30 15:25:21 -0400 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-08-30 15:25:21 -0400 |
commit | 4ae17c62944eab89acfa96a0912819093c872436 (patch) | |
tree | e02a60cdb6b324bd1b804d9e92778b80136545b7 | |
parent | 62856ab18f8992fb73cb27db40bbea9f29b5d1b6 (diff) | |
download | pleroma-4ae17c62944eab89acfa96a0912819093c872436.tar.gz pleroma-4ae17c62944eab89acfa96a0912819093c872436.zip |
NodeInfo: Accept application/activity+json requests
-rw-r--r-- | changelog.d/well-known.change | 1 | ||||
-rw-r--r-- | lib/pleroma/web/router.ex | 2 | ||||
-rw-r--r-- | test/pleroma/web/node_info_test.exs | 13 |
3 files changed, 15 insertions, 1 deletions
diff --git a/changelog.d/well-known.change b/changelog.d/well-known.change new file mode 100644 index 000000000..e928124fb --- /dev/null +++ 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 index 6492e3861..9e4b403e0 100644 --- 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 index f474220be..afe4ebb36 100644 --- 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 |