Phoenix detects the webfinger requests with content-type application/jrd+json as "jrd" now

This commit is contained in:
Mark Felder 2023-11-28 20:46:41 +00:00
parent 347e5f33c7
commit 1b5168ae02
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -30,7 +30,7 @@ def webfinger(%{assigns: %{format: format}} = conn, %{"resource" => resource})
end
def webfinger(%{assigns: %{format: format}} = conn, %{"resource" => resource})
when format in ["json", "jrd+json"] do
when format in ["jrd", "json", "jrd+json"] do
with {:ok, response} <- WebFinger.webfinger(resource, "JSON") do
json(conn, response)
else