mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-23 15:15:05 +01:00
Merge branch 'static-remote-redirect' into 'develop'
For remote notices, redirect to the original instead of 404 in static-fe See merge request pleroma/pleroma!1974
This commit is contained in:
commit
facc37aaa6
@ -77,6 +77,11 @@ defmodule Pleroma.Web.StaticFE.StaticFEController do
|
||||
|
||||
render(conn, "conversation.html", %{activities: timeline, meta: meta})
|
||||
else
|
||||
%Activity{object: %Object{data: data}} ->
|
||||
conn
|
||||
|> put_status(:found)
|
||||
|> redirect(external: data["url"] || data["external_url"] || data["id"])
|
||||
|
||||
_ ->
|
||||
conn
|
||||
|> put_status(404)
|
||||
|
@ -151,7 +151,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
|
||||
assert html_response(conn, 404) =~ "not found"
|
||||
end
|
||||
|
||||
test "404 for remote cached status", %{conn: conn} do
|
||||
test "302 for remote cached status", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
|
||||
message = %{
|
||||
@ -175,7 +175,7 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
|
||||
|> put_req_header("accept", "text/html")
|
||||
|> get("/notice/#{activity.id}")
|
||||
|
||||
assert html_response(conn, 404) =~ "not found"
|
||||
assert html_response(conn, 302) =~ "redirected"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user