end
pipeline :ostatus do
- plug(:accepts, ["xml", "atom", "html", "activity+json"])
+ plug(:accepts, ["html", "xml", "atom", "activity+json"])
+ end
+
+ pipeline :oembed do
+ plug(:accepts, ["json", "xml"])
end
scope "/", Pleroma.Web do
post("/push/subscriptions/:id", Websub.WebsubController, :websub_incoming)
end
+ scope "/", Pleroma.Web do
+ pipe_through(:oembed)
+
+ get("/oembed", OEmbed.OEmbedController, :url)
+ end
+
pipeline :activitypub do
plug(:accepts, ["activity+json"])
plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
defmodule Fallback.RedirectController do
use Pleroma.Web, :controller
+ alias Pleroma.Web.Metadata
def redirector(conn, _params) do
conn
|> send_file(200, Application.app_dir(:pleroma, "priv/static/index.html"))
end
+ def redirector_with_meta(conn, params) do
+ {:ok, index_content} = File.read(Application.app_dir(:pleroma, "priv/static/index.html"))
+ tags = Metadata.build_tags(params)
+ response = String.replace(index_content, "<!--server-generated-meta-->", tags)
+
+ conn
+ |> put_resp_content_type("text/html")
+ |> send_resp(200, response)
+ end
+
def registration_page(conn, params) do
redirector(conn, params)
end