|
1 | 1 | {
|
2 | 2 | "comment": [
|
| 3 | + "AS OF https://github.com/jsdom/whatwg-url/commit/35f04dfd3048cf6362f4398745bb13375c5020c2", |
3 | 4 | "## Tests for setters of https://url.spec.whatwg.org/#urlutils-members",
|
4 | 5 | "",
|
5 | 6 | "This file contains a JSON object.",
|
|
118 | 119 | "protocol": "http:"
|
119 | 120 | }
|
120 | 121 | },
|
| 122 | + { |
| 123 | + "href": "gopher://example.net:1234", |
| 124 | + "new_value": "file", |
| 125 | + "expected": { |
| 126 | + "href": "gopher://example.net:1234", |
| 127 | + "protocol": "gopher:" |
| 128 | + } |
| 129 | + }, |
121 | 130 | {
|
122 | 131 | "href": "wss://x:[email protected]:1234",
|
123 | 132 | "new_value": "file",
|
|
202 | 211 | "protocol": "ssh:"
|
203 | 212 | }
|
204 | 213 | },
|
| 214 | + { |
| 215 | + "href": "ssh://[email protected]", |
| 216 | + "new_value": "https", |
| 217 | + "expected": { |
| 218 | + "href": "ssh://[email protected]", |
| 219 | + "protocol": "ssh:" |
| 220 | + } |
| 221 | + }, |
205 | 222 | {
|
206 | 223 | "href": "ssh://[email protected]",
|
207 | 224 | "new_value": "file",
|
|
581 | 598 | }
|
582 | 599 | },
|
583 | 600 | {
|
584 |
| - "comment": "Cannot-be-a-base means no password", |
| 601 | + "comment": "Cannot-be-a-base means no host", |
585 | 602 | "href": "data:text/plain,Stuff",
|
586 | 603 | "new_value": "example.net",
|
587 | 604 | "expected": {
|
|
670 | 687 | "port": "2"
|
671 | 688 | }
|
672 | 689 | },
|
| 690 | + { |
| 691 | + "comment": "IPv6 literal address with port, crbug.com/1012416", |
| 692 | + "href": "http://example.net", |
| 693 | + "new_value": "[2001:db8::2]:4002", |
| 694 | + "expected": { |
| 695 | + "href": "http://[2001:db8::2]:4002/", |
| 696 | + "host": "[2001:db8::2]:4002", |
| 697 | + "hostname": "[2001:db8::2]", |
| 698 | + "port": "4002" |
| 699 | + } |
| 700 | + }, |
673 | 701 | {
|
674 | 702 | "comment": "Default port number is removed",
|
675 | 703 | "href": "http://example.net",
|
|
1048 | 1076 | }
|
1049 | 1077 | },
|
1050 | 1078 | {
|
1051 |
| - "comment": "Cannot-be-a-base means no password", |
| 1079 | + "comment": "Cannot-be-a-base means no host", |
1052 | 1080 | "href": "data:text/plain,Stuff",
|
1053 | 1081 | "new_value": "example.net",
|
1054 | 1082 | "expected": {
|
|
1800 | 1828 | "hash": "#foo%60bar"
|
1801 | 1829 | }
|
1802 | 1830 | },
|
| 1831 | + { |
| 1832 | + "comment": "Simple percent-encoding; tabs and newlines are removed", |
| 1833 | + "href": "a:/", |
| 1834 | + "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé", |
| 1835 | + "expected": { |
| 1836 | + "href": "a:/#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9", |
| 1837 | + "hash": "#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9" |
| 1838 | + } |
| 1839 | + }, |
| 1840 | + { |
| 1841 | + "comment": "Percent-encode NULLs in fragment", |
| 1842 | + "href": "http://example.net", |
| 1843 | + "new_value": "a\u0000b", |
| 1844 | + "expected": { |
| 1845 | + "href": "http://example.net/#a%00b", |
| 1846 | + "hash": "#a%00b" |
| 1847 | + } |
| 1848 | + }, |
| 1849 | + { |
| 1850 | + "comment": "Percent-encode NULLs in fragment", |
| 1851 | + "href": "non-spec:/", |
| 1852 | + "new_value": "a\u0000b", |
| 1853 | + "expected": { |
| 1854 | + "href": "non-spec:/#a%00b", |
| 1855 | + "hash": "#a%00b" |
| 1856 | + } |
| 1857 | + }, |
1803 | 1858 | {
|
1804 | 1859 | "comment": "Bytes already percent-encoded are left as-is",
|
1805 | 1860 | "href": "http://example.net",
|
|
0 commit comments