diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-07-09 09:08:59 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-07-09 09:08:59 -0500 |
commit | 49c4e2495357797caa82b4eb0a4d03e8c8dd2730 (patch) | |
tree | 7295ba98c7833534622a9c7fb27580691fbc06a5 /test/web/static_fe/static_fe_controller_test.exs | |
parent | da4029391d217b1e2c151e69479de42e2221e02f (diff) | |
parent | 8ca1f3e8c61b906387e9cb6fb8993d2ad496ab3d (diff) | |
download | pleroma-49c4e2495357797caa82b4eb0a4d03e8c8dd2730.tar.gz pleroma-49c4e2495357797caa82b4eb0a4d03e8c8dd2730.zip |
Merge branch 'develop' into fix/csp-for-captcha
Diffstat (limited to 'test/web/static_fe/static_fe_controller_test.exs')
-rw-r--r-- | test/web/static_fe/static_fe_controller_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/static_fe/static_fe_controller_test.exs b/test/web/static_fe/static_fe_controller_test.exs index a49ab002f..1598bf675 100644 --- a/test/web/static_fe/static_fe_controller_test.exs +++ b/test/web/static_fe/static_fe_controller_test.exs @@ -87,6 +87,20 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do assert html =~ "testing a thing!" end + test "redirects to json if requested", %{conn: conn, user: user} do + {:ok, activity} = CommonAPI.post(user, %{status: "testing a thing!"}) + + conn = + conn + |> put_req_header( + "accept", + "Accept: application/activity+json, application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\", text/html" + ) + |> get("/notice/#{activity.id}") + + assert redirected_to(conn, 302) =~ activity.data["object"] + end + test "filters HTML tags", %{conn: conn} do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{status: "<script>alert('xss')</script>"}) |