Skip to content

Commit

Permalink
URL: test setters with javascript URLs
Browse files Browse the repository at this point in the history
See whatwg/url#254 and
whatwg/html#2371 for changes to the standards.
  • Loading branch information
annevk committed Feb 22, 2017
1 parent 8c1d027 commit e8aa61d
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
"protocol": "b:"
}
},
{
"href": "javascript:alert(1)",
"new_value": "defuse",
"expected": {
"href": "defuse:alert(1)",
"protocol": "defuse:"
}
},
{
"comment": "Upper-case ASCII is lower-cased",
"href": "a://example.net",
Expand Down Expand Up @@ -215,6 +223,14 @@
"username": ""
}
},
{
"href": "javascript:alert(1)",
"new_value": "wario",
"expected": {
"href": "javascript:alert(1)",
"username": ""
}
},
{
"href": "http://example.net",
"new_value": "me",
Expand Down Expand Up @@ -273,6 +289,14 @@
"username": ""
}
},
{
"href": "javascript://x/",
"new_value": "wario",
"expected": {
"href": "javascript://wario@x/",
"username": "wario"
}
},
{
"href": "file://test/",
"new_value": "test",
Expand Down Expand Up @@ -368,6 +392,14 @@
"password": ""
}
},
{
"href": "javascript://x/",
"new_value": "bowser",
"expected": {
"href": "javascript://:bowser@x/",
"password": "bowser"
}
},
{
"href": "file://test/",
"new_value": "test",
Expand Down Expand Up @@ -1389,6 +1421,14 @@
"href": "sc://x:12/",
"port": "12"
}
},
{
"href": "javascript://x/",
"new_value": "12",
"expected": {
"href": "javascript://x:12/",
"port": "12"
}
}
],
"pathname": [
Expand Down Expand Up @@ -1648,6 +1688,14 @@
"href": "http://example.net/#%c3%89t%C3%A9",
"hash": "#%c3%89t%C3%A9"
}
},
{
"href": "javascript:alert(1)",
"new_value": "castle",
"expected": {
"href": "javascript:alert(1)#castle",
"hash": "#castle"
}
}
]
}

0 comments on commit e8aa61d

Please sign in to comment.