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:
Thomas Citharel
2021-03-23 19:28:19 +01:00
parent 346d6438f8
commit b002d905cb
2 changed files with 12 additions and 2 deletions

View File

@@ -9,6 +9,10 @@ defmodule Mobilizon.Web.Router do
plug(Mobilizon.Web.Auth.Pipeline)
end
pipeline :host_meta do
plug(:accepts, ["xrd-xml"])
end
pipeline :well_known do
plug(:accepts, ["json", "jrd-json"])
end
@@ -67,9 +71,14 @@ defmodule Mobilizon.Web.Router do
end
scope "/.well-known", Mobilizon.Web do
pipe_through(:well_known)
pipe_through(:host_meta)
get("/host-meta", WebFingerController, :host_meta)
end
scope "/.well-known", Mobilizon.Web do
pipe_through(:well_known)
get("/webfinger", WebFingerController, :webfinger)
get("/nodeinfo", NodeInfoController, :schemas)
get("/nodeinfo/:version", NodeInfoController, :nodeinfo)