|
|
@ -710,6 +710,7 @@ defmodule Pleroma.Web.Router do
|
|
|
|
scope "/", Fallback do
|
|
|
|
scope "/", Fallback do
|
|
|
|
get("/registration/:token", RedirectController, :registration_page)
|
|
|
|
get("/registration/:token", RedirectController, :registration_page)
|
|
|
|
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
|
|
|
|
get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
|
|
|
|
|
|
|
|
get("/api*path", RedirectController, :api_not_implemented)
|
|
|
|
get("/*path", RedirectController, :redirector)
|
|
|
|
get("/*path", RedirectController, :redirector)
|
|
|
|
|
|
|
|
|
|
|
|
options("/*path", RedirectController, :empty)
|
|
|
|
options("/*path", RedirectController, :empty)
|
|
|
@ -721,6 +722,12 @@ defmodule Fallback.RedirectController do
|
|
|
|
alias Pleroma.User
|
|
|
|
alias Pleroma.User
|
|
|
|
alias Pleroma.Web.Metadata
|
|
|
|
alias Pleroma.Web.Metadata
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def api_not_implemented(conn, _params) do
|
|
|
|
|
|
|
|
conn
|
|
|
|
|
|
|
|
|> put_status(404)
|
|
|
|
|
|
|
|
|> json(%{error: "Not implemented"})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def redirector(conn, _params, code \\ 200) do
|
|
|
|
def redirector(conn, _params, code \\ 200) do
|
|
|
|
conn
|
|
|
|
conn
|
|
|
|
|> put_resp_content_type("text/html")
|
|
|
|
|> put_resp_content_type("text/html")
|
|
|
|