Merge branch 'features/staticfe-sanitization' into 'develop'
static_fe: Sanitize HTML Closes #1614 See merge request pleroma/pleroma!2299
This commit is contained in:
parent
8096bfb891
commit
fcf51a77ba
7 changed files with 56 additions and 29 deletions
|
|
@ -110,8 +110,20 @@ defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do
|
|||
assert html =~ "testing a thing!"
|
||||
end
|
||||
|
||||
test "shows the whole thread", %{conn: conn} do
|
||||
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"})
|
||||
|
||||
CommonAPI.post(user, %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue