Skip to content

Commit

Permalink
Bug 1633277 [wpt PR 23256] - URL: Percent encode NULLs in fragments, …
Browse files Browse the repository at this point in the history
…a=testonly

Automatic update from web-platform-tests
URL: percent encode NULLs in fragments

See whatwg/url#440 and whatwg/url#486 for context.
--

wpt-commits: efec8204e84d434d80407bb7cf8df37d33cabaa1
wpt-pr: 23256
  • Loading branch information
rmisev committed Apr 28, 2020
1 parent 44b66a7 commit 5773e35
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 5 deletions.
24 changes: 21 additions & 3 deletions testing/web-platform/tests/url/resources/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1848,12 +1848,30 @@
}
},
{
"comment": "Simple percent-encoding; nuls, tabs, and newlines are removed",
"comment": "Simple percent-encoding; tabs and newlines are removed",
"href": "a:/",
"new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
"expected": {
"href": "a:/#%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9",
"hash": "#%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9"
"href": "a:/#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9",
"hash": "#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9"
}
},
{
"comment": "Percent-encode NULLs in fragment",
"href": "http://example.net",
"new_value": "a\u0000b",
"expected": {
"href": "http://example.net/#a%00b",
"hash": "#a%00b"
}
},
{
"comment": "Percent-encode NULLs in fragment",
"href": "non-spec:/",
"new_value": "a\u0000b",
"expected": {
"href": "non-spec:/#a%00b",
"hash": "#a%00b"
}
},
{
Expand Down
32 changes: 30 additions & 2 deletions testing/web-platform/tests/url/resources/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6672,7 +6672,7 @@
{
"input": "http://example.org/test?a#b\u0000c",
"base": "about:blank",
"href": "http://example.org/test?a#bc",
"href": "http://example.org/test?a#b%00c",
"protocol": "http:",
"username": "",
"password": "",
Expand All @@ -6681,7 +6681,35 @@
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#bc"
"hash": "#b%00c"
},
{
"input": "non-spec://example.org/test?a#b\u0000c",
"base": "about:blank",
"href": "non-spec://example.org/test?a#b%00c",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#b%00c"
},
{
"input": "non-spec:/test?a#b\u0000c",
"base": "about:blank",
"href": "non-spec:/test?a#b%00c",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#b%00c"
},
"First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
{
Expand Down

0 comments on commit 5773e35

Please sign in to comment.