diff options
author | rinpatch <rinpatch@sdf.org> | 2020-03-15 19:53:52 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-03-15 19:53:52 +0000 |
commit | df2608ebf80225bba1e9ce221251119548005e9c (patch) | |
tree | a0e029f4829b24707ea44a9f2fce21cdee5a3edb /test | |
parent | fa4ec17c841a65eccacdc35c98b6c047549b305b (diff) | |
parent | 8176ca9e4026d2de4fa0ab385b8c3f77e7f81daf (diff) | |
download | pleroma-df2608ebf80225bba1e9ce221251119548005e9c.tar.gz |
Merge branch 'features/staticfe-sanitization' into 'develop'
static_fe: Sanitize HTML
Closes #1614
See merge request pleroma/pleroma!2299
Diffstat (limited to 'test')
-rw-r--r-- | test/web/static_fe/static_fe_controller_test.exs | 13 |
1 files changed, 13 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 a072cc78f..c3d2ae3b4 100644 --- a/test/web/static_fe/static_fe_controller_test.exs +++ b/test/web/static_fe/static_fe_controller_test.exs @@ -92,6 +92,19 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do assert html =~ "testing a thing!" end + test "filters HTML tags", %{conn: conn} do + user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{"status" => "<script>alert('xss')</script>"}) + + conn = + conn + |> put_req_header("accept", "text/html") + |> get("/notice/#{activity.id}") + + html = html_response(conn, 200) + assert html =~ ~s[<script>alert('xss')</script>] + end + test "shows the whole thread", %{conn: conn, user: user} do {:ok, activity} = CommonAPI.post(user, %{"status" => "space: the final frontier"}) |