Handle more json-like content types

This commit is contained in:
Shadowfacts 2021-08-25 23:15:09 -04:00
parent 2bf3b156a7
commit 4851b5fd61
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,8 @@ config :logger, :console,
config :phoenix, :json_library, Jason config :phoenix, :json_library, Jason
config :mime, :types, %{ config :mime, :types, %{
"application/activity+json" => ["activity+json"] "application/activity+json" => ["activity+json"],
"application/jrd+json" => ["json"]
} }
config :http_signatures, adapter: Clacks.SignatureAdapter config :http_signatures, adapter: Clacks.SignatureAdapter

View File

@ -19,11 +19,11 @@ defmodule ClacksWeb.Router do
end end
pipeline :activitypub do pipeline :activitypub do
plug :accepts, ["activity+json", "html"] plug :accepts, ["activity+json", "json", "html"]
end end
pipeline :browser_or_activitypub do pipeline :browser_or_activitypub do
plug :accepts, ["html", "activity+json"] plug :accepts, ["html", "activity+json", "json"]
plug ClacksWeb.Plug.Format plug ClacksWeb.Plug.Format
plug :browser_if_html plug :browser_if_html
end end