Skip to content

Commit

Permalink
Failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkachowski committed Oct 29, 2024
1 parent ec6ffd1 commit 6fb1a2b
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,23 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewViewTest do
assert result == nil, "non http url schemes should be stripped from external_url and treated as missing"
end

test "does not return html escape" do
json = """
{
"name": "CELO XSS",
"image": "https://0-a.nl/nft/nft.jpg",
"description": "CELO XSS",
"external_url": "https\" id=x tabindex=1 onfocusin=eval(atob('KGZ1bmN0aW9uKCl7d2luZG93LmV0aG'))"
}
"""

data = Jason.decode!(json)

result = OverviewView.external_url(%{metadata: data})

assert result == nil, "non http url schemes should be stripped from external_url and treated as missing"
end

test "Returns valid uri scheme" do
json = """
{
Expand Down

0 comments on commit 6fb1a2b

Please sign in to comment.