Skip to content
Snippets Groups Projects
Verified Commit 71bb9007 authored by href's avatar href
Browse files

/notice/:id - send the FE index even if 404

this allows to open private activities by URL when you are logged in,
and to let the FE display a 404 page
parent 16ab1437
No related branches found
No related tags found
No related merge requests found
......@@ -166,10 +166,13 @@ defmodule Pleroma.Web.OStatus.OStatusController do
end
else
{:public?, false} ->
{:error, :not_found}
conn
|> put_status(404)
|> Fallback.RedirectController.redirector(nil, 404)
{:activity, nil} ->
{:error, :not_found}
conn
|> Fallback.RedirectController.redirector(nil, 404)
e ->
e
......
......@@ -523,10 +523,10 @@ defmodule Fallback.RedirectController do
alias Pleroma.Web.Metadata
alias Pleroma.User
def redirector(conn, _params) do
def redirector(conn, _params, code \\ 200) do
conn
|> put_resp_content_type("text/html")
|> send_file(200, index_file_path())
|> send_file(code, index_file_path())
end
def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id} = params) do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment