Skip to content

Commit 08fb40c

Browse files
committed
Bug 1633277 [wpt PR 23256] - URL: Percent encode NULLs in fragments, 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 UltraBlame original commit: 650ec6f46c2e17f43b3448bd91f3616e1622e3d9
1 parent 807289c commit 08fb40c

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

testing/web-platform/tests/url/resources/setters_tests.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,12 +1848,30 @@
18481848
}
18491849
},
18501850
{
1851-
"comment": "Simple percent-encoding; nuls, tabs, and newlines are removed",
1851+
"comment": "Simple percent-encoding; tabs and newlines are removed",
18521852
"href": "a:/",
18531853
"new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
18541854
"expected": {
1855-
"href": "a:/#%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9",
1856-
"hash": "#%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9"
1855+
"href": "a:/#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9",
1856+
"hash": "#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9"
1857+
}
1858+
},
1859+
{
1860+
"comment": "Percent-encode NULLs in fragment",
1861+
"href": "http://example.net",
1862+
"new_value": "a\u0000b",
1863+
"expected": {
1864+
"href": "http://example.net/#a%00b",
1865+
"hash": "#a%00b"
1866+
}
1867+
},
1868+
{
1869+
"comment": "Percent-encode NULLs in fragment",
1870+
"href": "non-spec:/",
1871+
"new_value": "a\u0000b",
1872+
"expected": {
1873+
"href": "non-spec:/#a%00b",
1874+
"hash": "#a%00b"
18571875
}
18581876
},
18591877
{

testing/web-platform/tests/url/resources/urltestdata.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6672,7 +6672,7 @@
66726672
{
66736673
"input": "http://example.org/test?a#b\u0000c",
66746674
"base": "about:blank",
6675-
"href": "http://example.org/test?a#bc",
6675+
"href": "http://example.org/test?a#b%00c",
66766676
"protocol": "http:",
66776677
"username": "",
66786678
"password": "",
@@ -6681,7 +6681,35 @@
66816681
"port": "",
66826682
"pathname": "/test",
66836683
"search": "?a",
6684-
"hash": "#bc"
6684+
"hash": "#b%00c"
6685+
},
6686+
{
6687+
"input": "non-spec://example.org/test?a#b\u0000c",
6688+
"base": "about:blank",
6689+
"href": "non-spec://example.org/test?a#b%00c",
6690+
"protocol": "non-spec:",
6691+
"username": "",
6692+
"password": "",
6693+
"host": "example.org",
6694+
"hostname": "example.org",
6695+
"port": "",
6696+
"pathname": "/test",
6697+
"search": "?a",
6698+
"hash": "#b%00c"
6699+
},
6700+
{
6701+
"input": "non-spec:/test?a#b\u0000c",
6702+
"base": "about:blank",
6703+
"href": "non-spec:/test?a#b%00c",
6704+
"protocol": "non-spec:",
6705+
"username": "",
6706+
"password": "",
6707+
"host": "",
6708+
"hostname": "",
6709+
"port": "",
6710+
"pathname": "/test",
6711+
"search": "?a",
6712+
"hash": "#b%00c"
66856713
},
66866714
"First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
66876715
{

0 commit comments

Comments
 (0)