Merge branch 'notice-404-to-fe' into 'develop'
/notice/:id - send the FE index even if 404 See merge request pleroma/pleroma!725
This commit is contained in:
commit
6db792124b
@ -166,10 +166,13 @@ def notice(conn, %{"id" => id}) do
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
{:public?, false} ->
|
{:public?, false} ->
|
||||||
{:error, :not_found}
|
conn
|
||||||
|
|> put_status(404)
|
||||||
|
|> Fallback.RedirectController.redirector(nil, 404)
|
||||||
|
|
||||||
{:activity, nil} ->
|
{:activity, nil} ->
|
||||||
{:error, :not_found}
|
conn
|
||||||
|
|> Fallback.RedirectController.redirector(nil, 404)
|
||||||
|
|
||||||
e ->
|
e ->
|
||||||
e
|
e
|
||||||
|
@ -523,10 +523,10 @@ defmodule Fallback.RedirectController do
|
|||||||
alias Pleroma.Web.Metadata
|
alias Pleroma.Web.Metadata
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
|
|
||||||
def redirector(conn, _params) do
|
def redirector(conn, _params, code \\ 200) do
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("text/html")
|
|> put_resp_content_type("text/html")
|
||||||
|> send_file(200, index_file_path())
|
|> send_file(code, index_file_path())
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id} = params) do
|
def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id} = params) do
|
||||||
|
Loading…
Reference in New Issue
Block a user