X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Frouter.ex;h=914cd6a6d2f53e9c6bea0b471881716a2e93764b;hb=b5de7c4c4d90d1049b59381953cbd76e79b77e66;hp=9c06fac4f30bf9a5d3a53d207037f0f83e78c629;hpb=729321ad20c7c4996b10ac86362a49f6d4cf0841;p=akkoma diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 9c06fac4f..914cd6a6d 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -351,7 +351,11 @@ defmodule Pleroma.Web.Router do 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 @@ -369,6 +373,12 @@ defmodule Pleroma.Web.Router 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) @@ -434,6 +444,7 @@ end defmodule Fallback.RedirectController do use Pleroma.Web, :controller + alias Pleroma.Web.Metadata def redirector(conn, _params) do conn @@ -441,6 +452,16 @@ defmodule Fallback.RedirectController do |> 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, "", tags) + + conn + |> put_resp_content_type("text/html") + |> send_resp(200, response) + end + def registration_page(conn, params) do redirector(conn, params) end