Handle calling .well-known/host-meta with "application/xrd+xml" accept
header Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
346d6438f8
commit
b002d905cb
|
@ -59,7 +59,8 @@ config :mobilizon, Mobilizon.Web.Endpoint,
|
||||||
config :mime, :types, %{
|
config :mime, :types, %{
|
||||||
"application/activity+json" => ["activity-json"],
|
"application/activity+json" => ["activity-json"],
|
||||||
"application/ld+json" => ["activity-json"],
|
"application/ld+json" => ["activity-json"],
|
||||||
"application/jrd+json" => ["jrd-json"]
|
"application/jrd+json" => ["jrd-json"],
|
||||||
|
"application/xrd+xml" => ["xrd-xml"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upload configuration
|
# Upload configuration
|
||||||
|
|
|
@ -9,6 +9,10 @@ defmodule Mobilizon.Web.Router do
|
||||||
plug(Mobilizon.Web.Auth.Pipeline)
|
plug(Mobilizon.Web.Auth.Pipeline)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pipeline :host_meta do
|
||||||
|
plug(:accepts, ["xrd-xml"])
|
||||||
|
end
|
||||||
|
|
||||||
pipeline :well_known do
|
pipeline :well_known do
|
||||||
plug(:accepts, ["json", "jrd-json"])
|
plug(:accepts, ["json", "jrd-json"])
|
||||||
end
|
end
|
||||||
|
@ -67,9 +71,14 @@ defmodule Mobilizon.Web.Router do
|
||||||
end
|
end
|
||||||
|
|
||||||
scope "/.well-known", Mobilizon.Web do
|
scope "/.well-known", Mobilizon.Web do
|
||||||
pipe_through(:well_known)
|
pipe_through(:host_meta)
|
||||||
|
|
||||||
get("/host-meta", WebFingerController, :host_meta)
|
get("/host-meta", WebFingerController, :host_meta)
|
||||||
|
end
|
||||||
|
|
||||||
|
scope "/.well-known", Mobilizon.Web do
|
||||||
|
pipe_through(:well_known)
|
||||||
|
|
||||||
get("/webfinger", WebFingerController, :webfinger)
|
get("/webfinger", WebFingerController, :webfinger)
|
||||||
get("/nodeinfo", NodeInfoController, :schemas)
|
get("/nodeinfo", NodeInfoController, :schemas)
|
||||||
get("/nodeinfo/:version", NodeInfoController, :nodeinfo)
|
get("/nodeinfo/:version", NodeInfoController, :nodeinfo)
|
||||||
|
|
Loading…
Reference in a new issue