2 "This file is based on testing/web-platform/tests/url/resources/urltestdata.json (with failing tests removed)",
4 "input": "http://example\t.\norg",
5 "base": "http://example.org/foo/bar",
6 "href": "http://example.org/",
7 "origin": "http://example.org",
11 "host": "example.org",
12 "hostname": "example.org",
19 "input": "http://user:pass@foo:21/bar;par?b#c",
20 "base": "http://example.org/foo/bar",
21 "href": "http://user:pass@foo:21/bar;par?b#c",
22 "origin": "http://foo:21",
29 "pathname": "/bar;par",
34 "input": "https://test:@test",
36 "href": "https://test@test/",
37 "origin": "https://test",
49 "input": "https://:@test",
51 "href": "https://test/",
52 "origin": "https://test",
64 "input": "non-special://test:@test/x",
66 "href": "non-special://test@test/x",
68 "protocol": "non-special:",
79 "input": "non-special://:@test/x",
81 "href": "non-special://test/x",
83 "protocol": "non-special:",
94 "input": "http:foo.com",
95 "base": "http://example.org/foo/bar",
96 "href": "http://example.org/foo/foo.com",
97 "origin": "http://example.org",
101 "host": "example.org",
102 "hostname": "example.org",
104 "pathname": "/foo/foo.com",
109 "input": "\t :foo.com \n",
110 "base": "http://example.org/foo/bar",
111 "href": "http://example.org/foo/:foo.com",
112 "origin": "http://example.org",
116 "host": "example.org",
117 "hostname": "example.org",
119 "pathname": "/foo/:foo.com",
124 "input": " foo.com ",
125 "base": "http://example.org/foo/bar",
126 "href": "http://example.org/foo/foo.com",
127 "origin": "http://example.org",
131 "host": "example.org",
132 "hostname": "example.org",
134 "pathname": "/foo/foo.com",
139 "input": "a:\t foo.com",
140 "base": "http://example.org/foo/bar",
141 "href": "a: foo.com",
149 "pathname": " foo.com",
154 "input": "http://f:21/ b ? d # e ",
155 "base": "http://example.org/foo/bar",
156 "href": "http://f:21/%20b%20?%20d%20#%20e",
157 "origin": "http://f:21",
164 "pathname": "/%20b%20",
165 "search": "?%20d%20",
169 "input": "lolscheme:x x#x x",
171 "href": "lolscheme:x x#x%20x",
172 "protocol": "lolscheme:",
183 "input": "http://f:/c",
184 "base": "http://example.org/foo/bar",
185 "href": "http://f/c",
186 "origin": "http://f",
198 "input": "http://f:0/c",
199 "base": "http://example.org/foo/bar",
200 "href": "http://f:0/c",
201 "origin": "http://f:0",
213 "input": "http://f:00000000000000/c",
214 "base": "http://example.org/foo/bar",
215 "href": "http://f:0/c",
216 "origin": "http://f:0",
228 "input": "http://f:00000000000000000000080/c",
229 "base": "http://example.org/foo/bar",
230 "href": "http://f/c",
231 "origin": "http://f",
243 "input": "http://f:b/c",
244 "base": "http://example.org/foo/bar",
248 "input": "http://f: /c",
249 "base": "http://example.org/foo/bar",
253 "input": "http://f:\n/c",
254 "base": "http://example.org/foo/bar",
255 "href": "http://f/c",
256 "origin": "http://f",
268 "input": "http://f:fifty-two/c",
269 "base": "http://example.org/foo/bar",
273 "input": "http://f:999999/c",
274 "base": "http://example.org/foo/bar",
278 "input": "non-special://f:999999/c",
279 "base": "http://example.org/foo/bar",
283 "input": "http://f: 21 / b ? d # e ",
284 "base": "http://example.org/foo/bar",
289 "base": "http://example.org/foo/bar",
290 "href": "http://example.org/foo/bar",
291 "origin": "http://example.org",
295 "host": "example.org",
296 "hostname": "example.org",
298 "pathname": "/foo/bar",
304 "base": "http://example.org/foo/bar",
305 "href": "http://example.org/foo/bar",
306 "origin": "http://example.org",
310 "host": "example.org",
311 "hostname": "example.org",
313 "pathname": "/foo/bar",
318 "input": ":foo.com/",
319 "base": "http://example.org/foo/bar",
320 "href": "http://example.org/foo/:foo.com/",
321 "origin": "http://example.org",
325 "host": "example.org",
326 "hostname": "example.org",
328 "pathname": "/foo/:foo.com/",
333 "input": ":foo.com\\",
334 "base": "http://example.org/foo/bar",
335 "href": "http://example.org/foo/:foo.com/",
336 "origin": "http://example.org",
340 "host": "example.org",
341 "hostname": "example.org",
343 "pathname": "/foo/:foo.com/",
349 "base": "http://example.org/foo/bar",
350 "href": "http://example.org/foo/:",
351 "origin": "http://example.org",
355 "host": "example.org",
356 "hostname": "example.org",
358 "pathname": "/foo/:",
364 "base": "http://example.org/foo/bar",
365 "href": "http://example.org/foo/:a",
366 "origin": "http://example.org",
370 "host": "example.org",
371 "hostname": "example.org",
373 "pathname": "/foo/:a",
379 "base": "http://example.org/foo/bar",
380 "href": "http://example.org/foo/:/",
381 "origin": "http://example.org",
385 "host": "example.org",
386 "hostname": "example.org",
388 "pathname": "/foo/:/",
394 "base": "http://example.org/foo/bar",
395 "href": "http://example.org/foo/:/",
396 "origin": "http://example.org",
400 "host": "example.org",
401 "hostname": "example.org",
403 "pathname": "/foo/:/",
409 "base": "http://example.org/foo/bar",
410 "href": "http://example.org/foo/:#",
411 "origin": "http://example.org",
415 "host": "example.org",
416 "hostname": "example.org",
418 "pathname": "/foo/:",
424 "base": "http://example.org/foo/bar",
425 "href": "http://example.org/foo/bar#",
426 "origin": "http://example.org",
430 "host": "example.org",
431 "hostname": "example.org",
433 "pathname": "/foo/bar",
439 "base": "http://example.org/foo/bar",
440 "href": "http://example.org/foo/bar#/",
441 "origin": "http://example.org",
445 "host": "example.org",
446 "hostname": "example.org",
448 "pathname": "/foo/bar",
454 "base": "http://example.org/foo/bar",
455 "href": "http://example.org/foo/bar#\\",
456 "origin": "http://example.org",
460 "host": "example.org",
461 "hostname": "example.org",
463 "pathname": "/foo/bar",
469 "base": "http://example.org/foo/bar",
470 "href": "http://example.org/foo/bar#;?",
471 "origin": "http://example.org",
475 "host": "example.org",
476 "hostname": "example.org",
478 "pathname": "/foo/bar",
484 "base": "http://example.org/foo/bar",
485 "href": "http://example.org/foo/bar?",
486 "origin": "http://example.org",
490 "host": "example.org",
491 "hostname": "example.org",
493 "pathname": "/foo/bar",
499 "base": "http://example.org/foo/bar",
500 "href": "http://example.org/",
501 "origin": "http://example.org",
505 "host": "example.org",
506 "hostname": "example.org",
514 "base": "http://example.org/foo/bar",
515 "href": "http://example.org/foo/:23",
516 "origin": "http://example.org",
520 "host": "example.org",
521 "hostname": "example.org",
523 "pathname": "/foo/:23",
529 "base": "http://example.org/foo/bar",
530 "href": "http://example.org/:23",
531 "origin": "http://example.org",
535 "host": "example.org",
536 "hostname": "example.org",
544 "base": "http://example.org/foo/bar",
545 "href": "http://example.org/x",
546 "origin": "http://example.org",
550 "host": "example.org",
551 "hostname": "example.org",
558 "input": "\\\\x\\hello",
559 "base": "http://example.org/foo/bar",
560 "href": "http://x/hello",
561 "origin": "http://x",
568 "pathname": "/hello",
574 "base": "http://example.org/foo/bar",
575 "href": "http://example.org/foo/::",
576 "origin": "http://example.org",
580 "host": "example.org",
581 "hostname": "example.org",
583 "pathname": "/foo/::",
589 "base": "http://example.org/foo/bar",
590 "href": "http://example.org/foo/::23",
591 "origin": "http://example.org",
595 "host": "example.org",
596 "hostname": "example.org",
598 "pathname": "/foo/::23",
604 "base": "http://example.org/foo/bar",
618 "input": "http://a:b@c:29/d",
619 "base": "http://example.org/foo/bar",
620 "href": "http://a:b@c:29/d",
621 "origin": "http://c:29",
633 "input": "http::@c:29",
634 "base": "http://example.org/foo/bar",
635 "href": "http://example.org/foo/:@c:29",
636 "origin": "http://example.org",
640 "host": "example.org",
641 "hostname": "example.org",
643 "pathname": "/foo/:@c:29",
648 "input": "http://&a:foo(b]c@d:2/",
649 "base": "http://example.org/foo/bar",
650 "href": "http://&a:foo(b%5Dc@d:2/",
651 "origin": "http://d:2",
654 "password": "foo(b%5Dc",
663 "input": "http://::@c@d:2",
664 "base": "http://example.org/foo/bar",
665 "href": "http://:%3A%40c@d:2/",
666 "origin": "http://d:2",
669 "password": "%3A%40c",
678 "input": "http://foo.com:b@d/",
679 "base": "http://example.org/foo/bar",
680 "href": "http://foo.com:b@d/",
681 "origin": "http://d",
683 "username": "foo.com",
693 "input": "http://foo.com/\\@",
694 "base": "http://example.org/foo/bar",
695 "href": "http://foo.com//@",
696 "origin": "http://foo.com",
701 "hostname": "foo.com",
708 "input": "http:\\\\foo.com\\",
709 "base": "http://example.org/foo/bar",
710 "href": "http://foo.com/",
711 "origin": "http://foo.com",
716 "hostname": "foo.com",
723 "input": "http:\\\\a\\b:c\\d@foo.com\\",
724 "base": "http://example.org/foo/bar",
725 "href": "http://a/b:c/d@foo.com/",
726 "origin": "http://a",
733 "pathname": "/b:c/d@foo.com/",
739 "base": "http://example.org/foo/bar",
753 "input": "foo:/bar.com/",
754 "base": "http://example.org/foo/bar",
755 "href": "foo:/bar.com/",
763 "pathname": "/bar.com/",
768 "input": "foo://///////",
769 "base": "http://example.org/foo/bar",
770 "href": "foo://///////",
778 "pathname": "///////",
783 "input": "foo://///////bar.com/",
784 "base": "http://example.org/foo/bar",
785 "href": "foo://///////bar.com/",
793 "pathname": "///////bar.com/",
798 "input": "foo:////://///",
799 "base": "http://example.org/foo/bar",
800 "href": "foo:////://///",
808 "pathname": "//://///",
814 "base": "http://example.org/foo/bar",
828 "input": "//foo/bar",
829 "base": "http://example.org/foo/bar",
830 "href": "http://foo/bar",
831 "origin": "http://foo",
843 "input": "http://foo/path;a??e#f#g",
844 "base": "http://example.org/foo/bar",
845 "href": "http://foo/path;a??e#f#g",
846 "origin": "http://foo",
853 "pathname": "/path;a",
858 "input": "http://foo/abcd?efgh?ijkl",
859 "base": "http://example.org/foo/bar",
860 "href": "http://foo/abcd?efgh?ijkl",
861 "origin": "http://foo",
869 "search": "?efgh?ijkl",
873 "input": "http://foo/abcd#foo?bar",
874 "base": "http://example.org/foo/bar",
875 "href": "http://foo/abcd#foo?bar",
876 "origin": "http://foo",
888 "input": "[61:24:74]:98",
889 "base": "http://example.org/foo/bar",
890 "href": "http://example.org/foo/[61:24:74]:98",
891 "origin": "http://example.org",
895 "host": "example.org",
896 "hostname": "example.org",
898 "pathname": "/foo/[61:24:74]:98",
903 "input": "http:[61:27]/:foo",
904 "base": "http://example.org/foo/bar",
905 "href": "http://example.org/foo/[61:27]/:foo",
906 "origin": "http://example.org",
910 "host": "example.org",
911 "hostname": "example.org",
913 "pathname": "/foo/[61:27]/:foo",
918 "input": "http://[1::2]:3:4",
919 "base": "http://example.org/foo/bar",
923 "input": "http://2001::1",
924 "base": "http://example.org/foo/bar",
928 "input": "http://2001::1]",
929 "base": "http://example.org/foo/bar",
933 "input": "http://2001::1]:80",
934 "base": "http://example.org/foo/bar",
938 "input": "http://[2001::1]",
939 "base": "http://example.org/foo/bar",
940 "href": "http://[2001::1]/",
941 "origin": "http://[2001::1]",
946 "hostname": "[2001::1]",
953 "input": "http://[::127.0.0.1]",
954 "base": "http://example.org/foo/bar",
955 "href": "http://[::7f00:1]/",
956 "origin": "http://[::7f00:1]",
960 "host": "[::7f00:1]",
961 "hostname": "[::7f00:1]",
968 "input": "http://[::127.0.0.1.]",
969 "base": "http://example.org/foo/bar",
973 "input": "http://[0:0:0:0:0:0:13.1.68.3]",
974 "base": "http://example.org/foo/bar",
975 "href": "http://[::d01:4403]/",
976 "origin": "http://[::d01:4403]",
980 "host": "[::d01:4403]",
981 "hostname": "[::d01:4403]",
988 "input": "http://[2001::1]:80",
989 "base": "http://example.org/foo/bar",
990 "href": "http://[2001::1]/",
991 "origin": "http://[2001::1]",
996 "hostname": "[2001::1]",
1003 "input": "http:/example.com/",
1004 "base": "http://example.org/foo/bar",
1005 "href": "http://example.org/example.com/",
1006 "origin": "http://example.org",
1007 "protocol": "http:",
1010 "host": "example.org",
1011 "hostname": "example.org",
1013 "pathname": "/example.com/",
1018 "input": "ftp:/example.com/",
1019 "base": "http://example.org/foo/bar",
1020 "href": "ftp://example.com/",
1021 "origin": "ftp://example.com",
1025 "host": "example.com",
1026 "hostname": "example.com",
1033 "input": "https:/example.com/",
1034 "base": "http://example.org/foo/bar",
1035 "href": "https://example.com/",
1036 "origin": "https://example.com",
1037 "protocol": "https:",
1040 "host": "example.com",
1041 "hostname": "example.com",
1048 "input": "madeupscheme:/example.com/",
1049 "base": "http://example.org/foo/bar",
1050 "href": "madeupscheme:/example.com/",
1052 "protocol": "madeupscheme:",
1058 "pathname": "/example.com/",
1063 "input": "file:/example.com/",
1064 "base": "http://example.org/foo/bar",
1065 "href": "file:///example.com/",
1066 "protocol": "file:",
1072 "pathname": "/example.com/",
1077 "input": "file://example:1/",
1082 "input": "file://example:test/",
1087 "input": "file://example%/",
1092 "input": "file://[example]/",
1097 "input": "ftps:/example.com/",
1098 "base": "http://example.org/foo/bar",
1099 "href": "ftps:/example.com/",
1101 "protocol": "ftps:",
1107 "pathname": "/example.com/",
1112 "input": "gopher:/example.com/",
1113 "base": "http://example.org/foo/bar",
1114 "href": "gopher:/example.com/",
1116 "protocol": "gopher:",
1122 "pathname": "/example.com/",
1127 "input": "ws:/example.com/",
1128 "base": "http://example.org/foo/bar",
1129 "href": "ws://example.com/",
1130 "origin": "ws://example.com",
1134 "host": "example.com",
1135 "hostname": "example.com",
1142 "input": "wss:/example.com/",
1143 "base": "http://example.org/foo/bar",
1144 "href": "wss://example.com/",
1145 "origin": "wss://example.com",
1149 "host": "example.com",
1150 "hostname": "example.com",
1157 "input": "data:/example.com/",
1158 "base": "http://example.org/foo/bar",
1159 "href": "data:/example.com/",
1161 "protocol": "data:",
1167 "pathname": "/example.com/",
1172 "input": "javascript:/example.com/",
1173 "base": "http://example.org/foo/bar",
1174 "href": "javascript:/example.com/",
1176 "protocol": "javascript:",
1182 "pathname": "/example.com/",
1187 "input": "mailto:/example.com/",
1188 "base": "http://example.org/foo/bar",
1189 "href": "mailto:/example.com/",
1191 "protocol": "mailto:",
1197 "pathname": "/example.com/",
1202 "input": "http:example.com/",
1203 "base": "http://example.org/foo/bar",
1204 "href": "http://example.org/foo/example.com/",
1205 "origin": "http://example.org",
1206 "protocol": "http:",
1209 "host": "example.org",
1210 "hostname": "example.org",
1212 "pathname": "/foo/example.com/",
1217 "input": "ftp:example.com/",
1218 "base": "http://example.org/foo/bar",
1219 "href": "ftp://example.com/",
1220 "origin": "ftp://example.com",
1224 "host": "example.com",
1225 "hostname": "example.com",
1232 "input": "https:example.com/",
1233 "base": "http://example.org/foo/bar",
1234 "href": "https://example.com/",
1235 "origin": "https://example.com",
1236 "protocol": "https:",
1239 "host": "example.com",
1240 "hostname": "example.com",
1247 "input": "madeupscheme:example.com/",
1248 "base": "http://example.org/foo/bar",
1249 "href": "madeupscheme:example.com/",
1251 "protocol": "madeupscheme:",
1257 "pathname": "example.com/",
1262 "input": "ftps:example.com/",
1263 "base": "http://example.org/foo/bar",
1264 "href": "ftps:example.com/",
1266 "protocol": "ftps:",
1272 "pathname": "example.com/",
1277 "input": "gopher:example.com/",
1278 "base": "http://example.org/foo/bar",
1279 "href": "gopher:example.com/",
1281 "protocol": "gopher:",
1287 "pathname": "example.com/",
1292 "input": "ws:example.com/",
1293 "base": "http://example.org/foo/bar",
1294 "href": "ws://example.com/",
1295 "origin": "ws://example.com",
1299 "host": "example.com",
1300 "hostname": "example.com",
1307 "input": "wss:example.com/",
1308 "base": "http://example.org/foo/bar",
1309 "href": "wss://example.com/",
1310 "origin": "wss://example.com",
1314 "host": "example.com",
1315 "hostname": "example.com",
1322 "input": "data:example.com/",
1323 "base": "http://example.org/foo/bar",
1324 "href": "data:example.com/",
1326 "protocol": "data:",
1332 "pathname": "example.com/",
1337 "input": "javascript:example.com/",
1338 "base": "http://example.org/foo/bar",
1339 "href": "javascript:example.com/",
1341 "protocol": "javascript:",
1347 "pathname": "example.com/",
1352 "input": "mailto:example.com/",
1353 "base": "http://example.org/foo/bar",
1354 "href": "mailto:example.com/",
1356 "protocol": "mailto:",
1362 "pathname": "example.com/",
1368 "base": "http://example.org/foo/bar",
1369 "href": "http://example.org/a/b/c",
1370 "origin": "http://example.org",
1371 "protocol": "http:",
1374 "host": "example.org",
1375 "hostname": "example.org",
1377 "pathname": "/a/b/c",
1383 "base": "http://example.org/foo/bar",
1384 "href": "http://example.org/a/%20/c",
1385 "origin": "http://example.org",
1386 "protocol": "http:",
1389 "host": "example.org",
1390 "hostname": "example.org",
1392 "pathname": "/a/%20/c",
1398 "base": "http://example.org/foo/bar",
1399 "href": "http://example.org/a%2fc",
1400 "origin": "http://example.org",
1401 "protocol": "http:",
1404 "host": "example.org",
1405 "hostname": "example.org",
1407 "pathname": "/a%2fc",
1412 "input": "/a/%2f/c",
1413 "base": "http://example.org/foo/bar",
1414 "href": "http://example.org/a/%2f/c",
1415 "origin": "http://example.org",
1416 "protocol": "http:",
1419 "host": "example.org",
1420 "hostname": "example.org",
1422 "pathname": "/a/%2f/c",
1428 "base": "http://example.org/foo/bar",
1429 "href": "http://example.org/foo/bar#%CE%B2",
1430 "origin": "http://example.org",
1431 "protocol": "http:",
1434 "host": "example.org",
1435 "hostname": "example.org",
1437 "pathname": "/foo/bar",
1442 "input": "data:text/html,test#test",
1443 "base": "http://example.org/foo/bar",
1444 "href": "data:text/html,test#test",
1446 "protocol": "data:",
1452 "pathname": "text/html,test",
1457 "input": "tel:1234567890",
1458 "base": "http://example.org/foo/bar",
1459 "href": "tel:1234567890",
1467 "pathname": "1234567890",
1471 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
1473 "input": "file:c:\\foo\\bar.html",
1474 "base": "file:///tmp/mock/path",
1475 "href": "file:///c:/foo/bar.html",
1476 "protocol": "file:",
1482 "pathname": "/c:/foo/bar.html",
1487 "input": " File:c|////foo\\bar.html",
1488 "base": "file:///tmp/mock/path",
1489 "href": "file:///c:////foo/bar.html",
1490 "protocol": "file:",
1496 "pathname": "/c:////foo/bar.html",
1501 "input": "C|/foo/bar",
1502 "base": "file:///tmp/mock/path",
1503 "href": "file:///C:/foo/bar",
1504 "protocol": "file:",
1510 "pathname": "/C:/foo/bar",
1515 "input": "/C|\\foo\\bar",
1516 "base": "file:///tmp/mock/path",
1517 "href": "file:///C:/foo/bar",
1518 "protocol": "file:",
1524 "pathname": "/C:/foo/bar",
1529 "input": "//C|/foo/bar",
1530 "base": "file:///tmp/mock/path",
1531 "href": "file:///C:/foo/bar",
1532 "protocol": "file:",
1538 "pathname": "/C:/foo/bar",
1543 "input": "//server/file",
1544 "base": "file:///tmp/mock/path",
1545 "href": "file://server/file",
1546 "protocol": "file:",
1550 "hostname": "server",
1552 "pathname": "/file",
1557 "input": "\\\\server\\file",
1558 "base": "file:///tmp/mock/path",
1559 "href": "file://server/file",
1560 "protocol": "file:",
1564 "hostname": "server",
1566 "pathname": "/file",
1571 "input": "/\\server/file",
1572 "base": "file:///tmp/mock/path",
1573 "href": "file://server/file",
1574 "protocol": "file:",
1578 "hostname": "server",
1580 "pathname": "/file",
1585 "input": "file:///foo/bar.txt",
1586 "base": "file:///tmp/mock/path",
1587 "href": "file:///foo/bar.txt",
1588 "protocol": "file:",
1594 "pathname": "/foo/bar.txt",
1599 "input": "file:///home/me",
1600 "base": "file:///tmp/mock/path",
1601 "href": "file:///home/me",
1602 "protocol": "file:",
1608 "pathname": "/home/me",
1614 "base": "file:///tmp/mock/path",
1616 "protocol": "file:",
1628 "base": "file:///tmp/mock/path",
1630 "protocol": "file:",
1642 "base": "file:///tmp/mock/path",
1643 "href": "file:///test",
1644 "protocol": "file:",
1650 "pathname": "/test",
1655 "input": "file://test",
1656 "base": "file:///tmp/mock/path",
1657 "href": "file://test/",
1658 "protocol": "file:",
1669 "input": "file://localhost",
1670 "base": "file:///tmp/mock/path",
1672 "protocol": "file:",
1683 "input": "file://localhost/",
1684 "base": "file:///tmp/mock/path",
1686 "protocol": "file:",
1697 "input": "file://localhost/test",
1698 "base": "file:///tmp/mock/path",
1699 "href": "file:///test",
1700 "protocol": "file:",
1706 "pathname": "/test",
1712 "base": "file:///tmp/mock/path",
1713 "href": "file:///tmp/mock/test",
1714 "protocol": "file:",
1720 "pathname": "/tmp/mock/test",
1725 "input": "file:test",
1726 "base": "file:///tmp/mock/path",
1727 "href": "file:///tmp/mock/test",
1728 "protocol": "file:",
1734 "pathname": "/tmp/mock/test",
1738 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
1740 "input": "http://example.com/././foo",
1742 "href": "http://example.com/foo",
1743 "origin": "http://example.com",
1744 "protocol": "http:",
1747 "host": "example.com",
1748 "hostname": "example.com",
1755 "input": "http://example.com/./.foo",
1757 "href": "http://example.com/.foo",
1758 "origin": "http://example.com",
1759 "protocol": "http:",
1762 "host": "example.com",
1763 "hostname": "example.com",
1765 "pathname": "/.foo",
1770 "input": "http://example.com/foo/.",
1772 "href": "http://example.com/foo/",
1773 "origin": "http://example.com",
1774 "protocol": "http:",
1777 "host": "example.com",
1778 "hostname": "example.com",
1780 "pathname": "/foo/",
1785 "input": "http://example.com/foo/./",
1787 "href": "http://example.com/foo/",
1788 "origin": "http://example.com",
1789 "protocol": "http:",
1792 "host": "example.com",
1793 "hostname": "example.com",
1795 "pathname": "/foo/",
1800 "input": "http://example.com/foo/bar/..",
1802 "href": "http://example.com/foo/",
1803 "origin": "http://example.com",
1804 "protocol": "http:",
1807 "host": "example.com",
1808 "hostname": "example.com",
1810 "pathname": "/foo/",
1815 "input": "http://example.com/foo/bar/../",
1817 "href": "http://example.com/foo/",
1818 "origin": "http://example.com",
1819 "protocol": "http:",
1822 "host": "example.com",
1823 "hostname": "example.com",
1825 "pathname": "/foo/",
1830 "input": "http://example.com/foo/..bar",
1832 "href": "http://example.com/foo/..bar",
1833 "origin": "http://example.com",
1834 "protocol": "http:",
1837 "host": "example.com",
1838 "hostname": "example.com",
1840 "pathname": "/foo/..bar",
1845 "input": "http://example.com/foo/bar/../ton",
1847 "href": "http://example.com/foo/ton",
1848 "origin": "http://example.com",
1849 "protocol": "http:",
1852 "host": "example.com",
1853 "hostname": "example.com",
1855 "pathname": "/foo/ton",
1860 "input": "http://example.com/foo/bar/../ton/../../a",
1862 "href": "http://example.com/a",
1863 "origin": "http://example.com",
1864 "protocol": "http:",
1867 "host": "example.com",
1868 "hostname": "example.com",
1875 "input": "http://example.com/foo/../../..",
1877 "href": "http://example.com/",
1878 "origin": "http://example.com",
1879 "protocol": "http:",
1882 "host": "example.com",
1883 "hostname": "example.com",
1890 "input": "http://example.com/foo/../../../ton",
1892 "href": "http://example.com/ton",
1893 "origin": "http://example.com",
1894 "protocol": "http:",
1897 "host": "example.com",
1898 "hostname": "example.com",
1905 "input": "http://example.com/foo/%2e",
1907 "href": "http://example.com/foo/",
1908 "origin": "http://example.com",
1909 "protocol": "http:",
1912 "host": "example.com",
1913 "hostname": "example.com",
1915 "pathname": "/foo/",
1920 "input": "http://example.com/foo/%2e%2",
1922 "href": "http://example.com/foo/%2e%2",
1923 "origin": "http://example.com",
1924 "protocol": "http:",
1927 "host": "example.com",
1928 "hostname": "example.com",
1930 "pathname": "/foo/%2e%2",
1935 "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
1937 "href": "http://example.com/%2e.bar",
1938 "origin": "http://example.com",
1939 "protocol": "http:",
1942 "host": "example.com",
1943 "hostname": "example.com",
1945 "pathname": "/%2e.bar",
1950 "input": "http://example.com////../..",
1952 "href": "http://example.com//",
1953 "origin": "http://example.com",
1954 "protocol": "http:",
1957 "host": "example.com",
1958 "hostname": "example.com",
1965 "input": "http://example.com/foo/bar//../..",
1967 "href": "http://example.com/foo/",
1968 "origin": "http://example.com",
1969 "protocol": "http:",
1972 "host": "example.com",
1973 "hostname": "example.com",
1975 "pathname": "/foo/",
1980 "input": "http://example.com/foo/bar//..",
1982 "href": "http://example.com/foo/bar/",
1983 "origin": "http://example.com",
1984 "protocol": "http:",
1987 "host": "example.com",
1988 "hostname": "example.com",
1990 "pathname": "/foo/bar/",
1995 "input": "http://example.com/foo",
1997 "href": "http://example.com/foo",
1998 "origin": "http://example.com",
1999 "protocol": "http:",
2002 "host": "example.com",
2003 "hostname": "example.com",
2010 "input": "http://example.com/%20foo",
2012 "href": "http://example.com/%20foo",
2013 "origin": "http://example.com",
2014 "protocol": "http:",
2017 "host": "example.com",
2018 "hostname": "example.com",
2020 "pathname": "/%20foo",
2025 "input": "http://example.com/foo%",
2027 "href": "http://example.com/foo%",
2028 "origin": "http://example.com",
2029 "protocol": "http:",
2032 "host": "example.com",
2033 "hostname": "example.com",
2035 "pathname": "/foo%",
2040 "input": "http://example.com/foo%2",
2042 "href": "http://example.com/foo%2",
2043 "origin": "http://example.com",
2044 "protocol": "http:",
2047 "host": "example.com",
2048 "hostname": "example.com",
2050 "pathname": "/foo%2",
2055 "input": "http://example.com/foo%2zbar",
2057 "href": "http://example.com/foo%2zbar",
2058 "origin": "http://example.com",
2059 "protocol": "http:",
2062 "host": "example.com",
2063 "hostname": "example.com",
2065 "pathname": "/foo%2zbar",
2070 "input": "http://example.com/foo%2©zbar",
2072 "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
2073 "origin": "http://example.com",
2074 "protocol": "http:",
2077 "host": "example.com",
2078 "hostname": "example.com",
2080 "pathname": "/foo%2%C3%82%C2%A9zbar",
2085 "input": "http://example.com/foo%41%7a",
2087 "href": "http://example.com/foo%41%7a",
2088 "origin": "http://example.com",
2089 "protocol": "http:",
2092 "host": "example.com",
2093 "hostname": "example.com",
2095 "pathname": "/foo%41%7a",
2100 "input": "http://example.com/foo\t\u0091%91",
2102 "href": "http://example.com/foo%C2%91%91",
2103 "origin": "http://example.com",
2104 "protocol": "http:",
2107 "host": "example.com",
2108 "hostname": "example.com",
2110 "pathname": "/foo%C2%91%91",
2115 "input": "http://example.com/foo%00%51",
2117 "href": "http://example.com/foo%00%51",
2118 "origin": "http://example.com",
2119 "protocol": "http:",
2122 "host": "example.com",
2123 "hostname": "example.com",
2125 "pathname": "/foo%00%51",
2130 "input": "http://example.com/(%28:%3A%29)",
2132 "href": "http://example.com/(%28:%3A%29)",
2133 "origin": "http://example.com",
2134 "protocol": "http:",
2137 "host": "example.com",
2138 "hostname": "example.com",
2140 "pathname": "/(%28:%3A%29)",
2145 "input": "http://example.com/%3A%3a%3C%3c",
2147 "href": "http://example.com/%3A%3a%3C%3c",
2148 "origin": "http://example.com",
2149 "protocol": "http:",
2152 "host": "example.com",
2153 "hostname": "example.com",
2155 "pathname": "/%3A%3a%3C%3c",
2160 "input": "http://example.com/foo\tbar",
2162 "href": "http://example.com/foobar",
2163 "origin": "http://example.com",
2164 "protocol": "http:",
2167 "host": "example.com",
2168 "hostname": "example.com",
2170 "pathname": "/foobar",
2175 "input": "http://example.com\\\\foo\\\\bar",
2177 "href": "http://example.com//foo//bar",
2178 "origin": "http://example.com",
2179 "protocol": "http:",
2182 "host": "example.com",
2183 "hostname": "example.com",
2185 "pathname": "//foo//bar",
2190 "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2192 "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2193 "origin": "http://example.com",
2194 "protocol": "http:",
2197 "host": "example.com",
2198 "hostname": "example.com",
2200 "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
2205 "input": "http://example.com/@asdf%40",
2207 "href": "http://example.com/@asdf%40",
2208 "origin": "http://example.com",
2209 "protocol": "http:",
2212 "host": "example.com",
2213 "hostname": "example.com",
2215 "pathname": "/@asdf%40",
2220 "input": "http://example.com/你好你好",
2222 "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2223 "origin": "http://example.com",
2224 "protocol": "http:",
2227 "host": "example.com",
2228 "hostname": "example.com",
2230 "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2235 "input": "http://example.com/‥/foo",
2237 "href": "http://example.com/%E2%80%A5/foo",
2238 "origin": "http://example.com",
2239 "protocol": "http:",
2242 "host": "example.com",
2243 "hostname": "example.com",
2245 "pathname": "/%E2%80%A5/foo",
2250 "input": "http://example.com//foo",
2252 "href": "http://example.com/%EF%BB%BF/foo",
2253 "origin": "http://example.com",
2254 "protocol": "http:",
2257 "host": "example.com",
2258 "hostname": "example.com",
2260 "pathname": "/%EF%BB%BF/foo",
2265 "input": "http://example.com//foo//bar",
2267 "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
2268 "origin": "http://example.com",
2269 "protocol": "http:",
2272 "host": "example.com",
2273 "hostname": "example.com",
2275 "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
2279 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
2281 "input": "http://www.google.com/foo?bar=baz#",
2283 "href": "http://www.google.com/foo?bar=baz#",
2284 "origin": "http://www.google.com",
2285 "protocol": "http:",
2288 "host": "www.google.com",
2289 "hostname": "www.google.com",
2292 "search": "?bar=baz",
2296 "input": "http://www.google.com/foo?bar=baz# »",
2298 "href": "http://www.google.com/foo?bar=baz#%20%C2%BB",
2299 "origin": "http://www.google.com",
2300 "protocol": "http:",
2303 "host": "www.google.com",
2304 "hostname": "www.google.com",
2307 "search": "?bar=baz",
2308 "hash": "#%20%C2%BB"
2311 "input": "data:test# »",
2313 "href": "data:test#%20%C2%BB",
2315 "protocol": "data:",
2323 "hash": "#%20%C2%BB"
2326 "input": "http://www.google.com",
2328 "href": "http://www.google.com/",
2329 "origin": "http://www.google.com",
2330 "protocol": "http:",
2333 "host": "www.google.com",
2334 "hostname": "www.google.com",
2341 "input": "http://192.0x00A80001",
2343 "href": "http://192.168.0.1/",
2344 "origin": "http://192.168.0.1",
2345 "protocol": "http:",
2348 "host": "192.168.0.1",
2349 "hostname": "192.168.0.1",
2356 "input": "http://www/foo%2Ehtml",
2358 "href": "http://www/foo%2Ehtml",
2359 "origin": "http://www",
2360 "protocol": "http:",
2366 "pathname": "/foo%2Ehtml",
2371 "input": "http://www/foo/%2E/html",
2373 "href": "http://www/foo/html",
2374 "origin": "http://www",
2375 "protocol": "http:",
2381 "pathname": "/foo/html",
2386 "input": "http://user:pass@/",
2391 "input": "http://%25DOMAIN:foobar@foodomain.com/",
2393 "href": "http://%25DOMAIN:foobar@foodomain.com/",
2394 "origin": "http://foodomain.com",
2395 "protocol": "http:",
2396 "username": "%25DOMAIN",
2397 "password": "foobar",
2398 "host": "foodomain.com",
2399 "hostname": "foodomain.com",
2406 "input": "http:\\\\www.google.com\\foo",
2408 "href": "http://www.google.com/foo",
2409 "origin": "http://www.google.com",
2410 "protocol": "http:",
2413 "host": "www.google.com",
2414 "hostname": "www.google.com",
2421 "input": "http://foo:80/",
2423 "href": "http://foo/",
2424 "origin": "http://foo",
2425 "protocol": "http:",
2436 "input": "http://foo:81/",
2438 "href": "http://foo:81/",
2439 "origin": "http://foo:81",
2440 "protocol": "http:",
2451 "input": "httpa://foo:80/",
2453 "href": "httpa://foo:80/",
2455 "protocol": "httpa:",
2466 "input": "http://foo:-80/",
2471 "input": "https://foo:443/",
2473 "href": "https://foo/",
2474 "origin": "https://foo",
2475 "protocol": "https:",
2486 "input": "https://foo:80/",
2488 "href": "https://foo:80/",
2489 "origin": "https://foo:80",
2490 "protocol": "https:",
2501 "input": "ftp://foo:21/",
2503 "href": "ftp://foo/",
2504 "origin": "ftp://foo",
2516 "input": "ftp://foo:80/",
2518 "href": "ftp://foo:80/",
2519 "origin": "ftp://foo:80",
2531 "input": "gopher://foo:70/",
2533 "href": "gopher://foo:70/",
2535 "protocol": "gopher:",
2546 "input": "gopher://foo:443/",
2548 "href": "gopher://foo:443/",
2550 "protocol": "gopher:",
2561 "input": "ws://foo:80/",
2563 "href": "ws://foo/",
2564 "origin": "ws://foo",
2576 "input": "ws://foo:81/",
2578 "href": "ws://foo:81/",
2579 "origin": "ws://foo:81",
2591 "input": "ws://foo:443/",
2593 "href": "ws://foo:443/",
2594 "origin": "ws://foo:443",
2606 "input": "ws://foo:815/",
2608 "href": "ws://foo:815/",
2609 "origin": "ws://foo:815",
2621 "input": "wss://foo:80/",
2623 "href": "wss://foo:80/",
2624 "origin": "wss://foo:80",
2636 "input": "wss://foo:81/",
2638 "href": "wss://foo:81/",
2639 "origin": "wss://foo:81",
2651 "input": "wss://foo:443/",
2653 "href": "wss://foo/",
2654 "origin": "wss://foo",
2666 "input": "wss://foo:815/",
2668 "href": "wss://foo:815/",
2669 "origin": "wss://foo:815",
2681 "input": "ftp:/example.com/",
2683 "href": "ftp://example.com/",
2684 "origin": "ftp://example.com",
2688 "host": "example.com",
2689 "hostname": "example.com",
2696 "input": "https:/example.com/",
2698 "href": "https://example.com/",
2699 "origin": "https://example.com",
2700 "protocol": "https:",
2703 "host": "example.com",
2704 "hostname": "example.com",
2711 "input": "madeupscheme:/example.com/",
2713 "href": "madeupscheme:/example.com/",
2715 "protocol": "madeupscheme:",
2721 "pathname": "/example.com/",
2726 "input": "file:/example.com/",
2728 "href": "file:///example.com/",
2729 "protocol": "file:",
2735 "pathname": "/example.com/",
2740 "input": "ftps:/example.com/",
2742 "href": "ftps:/example.com/",
2744 "protocol": "ftps:",
2750 "pathname": "/example.com/",
2755 "input": "gopher:/example.com/",
2757 "href": "gopher:/example.com/",
2759 "protocol": "gopher:",
2765 "pathname": "/example.com/",
2770 "input": "ws:/example.com/",
2772 "href": "ws://example.com/",
2773 "origin": "ws://example.com",
2777 "host": "example.com",
2778 "hostname": "example.com",
2785 "input": "wss:/example.com/",
2787 "href": "wss://example.com/",
2788 "origin": "wss://example.com",
2792 "host": "example.com",
2793 "hostname": "example.com",
2800 "input": "data:/example.com/",
2802 "href": "data:/example.com/",
2804 "protocol": "data:",
2810 "pathname": "/example.com/",
2815 "input": "javascript:/example.com/",
2817 "href": "javascript:/example.com/",
2819 "protocol": "javascript:",
2825 "pathname": "/example.com/",
2830 "input": "mailto:/example.com/",
2832 "href": "mailto:/example.com/",
2834 "protocol": "mailto:",
2840 "pathname": "/example.com/",
2845 "input": "ftp:example.com/",
2847 "href": "ftp://example.com/",
2848 "origin": "ftp://example.com",
2852 "host": "example.com",
2853 "hostname": "example.com",
2860 "input": "https:example.com/",
2862 "href": "https://example.com/",
2863 "origin": "https://example.com",
2864 "protocol": "https:",
2867 "host": "example.com",
2868 "hostname": "example.com",
2875 "input": "madeupscheme:example.com/",
2877 "href": "madeupscheme:example.com/",
2879 "protocol": "madeupscheme:",
2885 "pathname": "example.com/",
2890 "input": "ftps:example.com/",
2892 "href": "ftps:example.com/",
2894 "protocol": "ftps:",
2900 "pathname": "example.com/",
2905 "input": "gopher:example.com/",
2907 "href": "gopher:example.com/",
2909 "protocol": "gopher:",
2915 "pathname": "example.com/",
2920 "input": "ws:example.com/",
2922 "href": "ws://example.com/",
2923 "origin": "ws://example.com",
2927 "host": "example.com",
2928 "hostname": "example.com",
2935 "input": "wss:example.com/",
2937 "href": "wss://example.com/",
2938 "origin": "wss://example.com",
2942 "host": "example.com",
2943 "hostname": "example.com",
2950 "input": "data:example.com/",
2952 "href": "data:example.com/",
2954 "protocol": "data:",
2960 "pathname": "example.com/",
2965 "input": "javascript:example.com/",
2967 "href": "javascript:example.com/",
2969 "protocol": "javascript:",
2975 "pathname": "example.com/",
2980 "input": "mailto:example.com/",
2982 "href": "mailto:example.com/",
2984 "protocol": "mailto:",
2990 "pathname": "example.com/",
2995 "input": "http://@www.example.com",
2997 "href": "http://www.example.com/",
2998 "origin": "http://www.example.com",
2999 "protocol": "http:",
3002 "host": "www.example.com",
3003 "hostname": "www.example.com",
3010 "input": "http://a:b@www.example.com",
3012 "href": "http://a:b@www.example.com/",
3013 "origin": "http://www.example.com",
3014 "protocol": "http:",
3017 "host": "www.example.com",
3018 "hostname": "www.example.com",
3025 "input": "http://@pple.com",
3027 "href": "http://pple.com/",
3028 "origin": "http://pple.com",
3029 "protocol": "http:",
3033 "hostname": "pple.com",
3040 "input": "http://:b@www.example.com",
3042 "href": "http://:b@www.example.com/",
3043 "origin": "http://www.example.com",
3044 "protocol": "http:",
3047 "host": "www.example.com",
3048 "hostname": "www.example.com",
3055 "input": "http:/:@/www.example.com",
3058 "relativeTo": "non-opaque-path-base"
3061 "input": "http://user@/www.example.com",
3066 "input": "http:@/www.example.com",
3069 "relativeTo": "non-opaque-path-base"
3072 "input": "http:/@/www.example.com",
3075 "relativeTo": "non-opaque-path-base"
3078 "input": "http://@/www.example.com",
3083 "input": "https:@/www.example.com",
3086 "relativeTo": "non-opaque-path-base"
3089 "input": "http:a:b@/www.example.com",
3092 "relativeTo": "non-opaque-path-base"
3095 "input": "http:/a:b@/www.example.com",
3098 "relativeTo": "non-opaque-path-base"
3101 "input": "http://a:b@/www.example.com",
3106 "input": "http::@/www.example.com",
3109 "relativeTo": "non-opaque-path-base"
3112 "input": "http://a:@www.example.com",
3114 "href": "http://a@www.example.com/",
3115 "origin": "http://www.example.com",
3116 "protocol": "http:",
3119 "host": "www.example.com",
3120 "hostname": "www.example.com",
3127 "input": "http://www.@pple.com",
3129 "href": "http://www.@pple.com/",
3130 "origin": "http://pple.com",
3131 "protocol": "http:",
3135 "hostname": "pple.com",
3142 "input": "http:@:www.example.com",
3145 "relativeTo": "non-opaque-path-base"
3148 "input": "http:/@:www.example.com",
3151 "relativeTo": "non-opaque-path-base"
3154 "input": "http://@:www.example.com",
3159 "input": "http://:@www.example.com",
3161 "href": "http://www.example.com/",
3162 "origin": "http://www.example.com",
3163 "protocol": "http:",
3166 "host": "www.example.com",
3167 "hostname": "www.example.com",
3176 "base": "http://www.example.com/test",
3177 "href": "http://www.example.com/",
3178 "origin": "http://www.example.com",
3179 "protocol": "http:",
3182 "host": "www.example.com",
3183 "hostname": "www.example.com",
3190 "input": "/test.txt",
3191 "base": "http://www.example.com/test",
3192 "href": "http://www.example.com/test.txt",
3193 "origin": "http://www.example.com",
3194 "protocol": "http:",
3197 "host": "www.example.com",
3198 "hostname": "www.example.com",
3200 "pathname": "/test.txt",
3206 "base": "http://www.example.com/test",
3207 "href": "http://www.example.com/",
3208 "origin": "http://www.example.com",
3209 "protocol": "http:",
3212 "host": "www.example.com",
3213 "hostname": "www.example.com",
3221 "base": "http://www.example.com/test",
3222 "href": "http://www.example.com/",
3223 "origin": "http://www.example.com",
3224 "protocol": "http:",
3227 "host": "www.example.com",
3228 "hostname": "www.example.com",
3235 "input": "test.txt",
3236 "base": "http://www.example.com/test",
3237 "href": "http://www.example.com/test.txt",
3238 "origin": "http://www.example.com",
3239 "protocol": "http:",
3242 "host": "www.example.com",
3243 "hostname": "www.example.com",
3245 "pathname": "/test.txt",
3250 "input": "./test.txt",
3251 "base": "http://www.example.com/test",
3252 "href": "http://www.example.com/test.txt",
3253 "origin": "http://www.example.com",
3254 "protocol": "http:",
3257 "host": "www.example.com",
3258 "hostname": "www.example.com",
3260 "pathname": "/test.txt",
3265 "input": "../test.txt",
3266 "base": "http://www.example.com/test",
3267 "href": "http://www.example.com/test.txt",
3268 "origin": "http://www.example.com",
3269 "protocol": "http:",
3272 "host": "www.example.com",
3273 "hostname": "www.example.com",
3275 "pathname": "/test.txt",
3280 "input": "../aaa/test.txt",
3281 "base": "http://www.example.com/test",
3282 "href": "http://www.example.com/aaa/test.txt",
3283 "origin": "http://www.example.com",
3284 "protocol": "http:",
3287 "host": "www.example.com",
3288 "hostname": "www.example.com",
3290 "pathname": "/aaa/test.txt",
3295 "input": "../../test.txt",
3296 "base": "http://www.example.com/test",
3297 "href": "http://www.example.com/test.txt",
3298 "origin": "http://www.example.com",
3299 "protocol": "http:",
3302 "host": "www.example.com",
3303 "hostname": "www.example.com",
3305 "pathname": "/test.txt",
3310 "input": "中/test.txt",
3311 "base": "http://www.example.com/test",
3312 "href": "http://www.example.com/%E4%B8%AD/test.txt",
3313 "origin": "http://www.example.com",
3314 "protocol": "http:",
3317 "host": "www.example.com",
3318 "hostname": "www.example.com",
3320 "pathname": "/%E4%B8%AD/test.txt",
3325 "input": "http://www.example2.com",
3326 "base": "http://www.example.com/test",
3327 "href": "http://www.example2.com/",
3328 "origin": "http://www.example2.com",
3329 "protocol": "http:",
3332 "host": "www.example2.com",
3333 "hostname": "www.example2.com",
3340 "input": "//www.example2.com",
3341 "base": "http://www.example.com/test",
3342 "href": "http://www.example2.com/",
3343 "origin": "http://www.example2.com",
3344 "protocol": "http:",
3347 "host": "www.example2.com",
3348 "hostname": "www.example2.com",
3355 "input": "file:...",
3356 "base": "http://www.example.com/test",
3357 "href": "file:///...",
3358 "protocol": "file:",
3370 "base": "http://www.example.com/test",
3372 "protocol": "file:",
3384 "base": "http://www.example.com/test",
3385 "href": "file:///a",
3386 "protocol": "file:",
3396 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
3397 "Basic canonicalization, uppercase should be converted to lowercase",
3399 "input": "http://ExAmPlE.CoM",
3400 "base": "http://other.com/",
3401 "href": "http://example.com/",
3402 "origin": "http://example.com",
3403 "protocol": "http:",
3406 "host": "example.com",
3407 "hostname": "example.com",
3414 "input": "http://example example.com",
3415 "base": "http://other.com/",
3419 "input": "http://Goo%20 goo%7C|.com",
3420 "base": "http://other.com/",
3424 "input": "http://[]",
3425 "base": "http://other.com/",
3429 "input": "http://[:]",
3430 "base": "http://other.com/",
3433 "U+3000 is mapped to U+0020 (space) which is disallowed",
3435 "input": "http://GOO\u00a0\u3000goo.com",
3436 "base": "http://other.com/",
3439 "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored",
3441 "input": "http://GOO\u200b\u2060\ufeffgoo.com",
3442 "base": "http://other.com/",
3443 "href": "http://googoo.com/",
3444 "origin": "http://googoo.com",
3445 "protocol": "http:",
3448 "host": "googoo.com",
3449 "hostname": "googoo.com",
3455 "Leading and trailing C0 control or space",
3457 "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
3459 "href": "http://example.com/",
3460 "origin": "http://example.com",
3461 "protocol": "http:",
3464 "host": "example.com",
3465 "hostname": "example.com",
3471 "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
3473 "input": "http://www.foo。bar.com",
3474 "base": "http://other.com/",
3475 "href": "http://www.foo.bar.com/",
3476 "origin": "http://www.foo.bar.com",
3477 "protocol": "http:",
3480 "host": "www.foo.bar.com",
3481 "hostname": "www.foo.bar.com",
3487 "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
3489 "input": "http://\ufdd0zyx.com",
3490 "base": "http://other.com/",
3493 "This is the same as previous but escaped",
3495 "input": "http://%ef%b7%90zyx.com",
3496 "base": "http://other.com/",
3501 "input": "https://\ufffd",
3506 "input": "https://%EF%BF%BD",
3511 "input": "https://x/\ufffd?\ufffd#\ufffd",
3513 "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD",
3514 "origin": "https://x",
3515 "protocol": "https:",
3521 "pathname": "/%EF%BF%BD",
3522 "search": "?%EF%BF%BD",
3523 "hash": "#%EF%BF%BD"
3525 "Domain is ASCII, but a label is invalid IDNA",
3527 "input": "http://a.b.c.xn--pokxncvks",
3532 "input": "http://10.0.0.xn--pokxncvks",
3536 "IDNA labels should be matched case-insensitively",
3538 "input": "http://a.b.c.XN--pokxncvks",
3543 "input": "http://a.b.c.Xn--pokxncvks",
3548 "input": "http://10.0.0.XN--pokxncvks",
3553 "input": "http://10.0.0.xN--pokxncvks",
3557 "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
3559 "input": "http://Go.com",
3560 "base": "http://other.com/",
3561 "href": "http://go.com/",
3562 "origin": "http://go.com",
3563 "protocol": "http:",
3567 "hostname": "go.com",
3573 "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
3575 "input": "http://%41.com",
3576 "base": "http://other.com/",
3580 "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
3581 "base": "http://other.com/",
3584 "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
3586 "input": "http://%00.com",
3587 "base": "http://other.com/",
3591 "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
3592 "base": "http://other.com/",
3595 "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
3597 "input": "http://你好你好",
3598 "base": "http://other.com/",
3599 "href": "http://xn--6qqa088eba/",
3600 "origin": "http://xn--6qqa088eba",
3601 "protocol": "http:",
3604 "host": "xn--6qqa088eba",
3605 "hostname": "xn--6qqa088eba",
3612 "input": "https://faß.ExAmPlE/",
3614 "href": "https://xn--fa-hia.example/",
3615 "origin": "https://xn--fa-hia.example",
3616 "protocol": "https:",
3619 "host": "xn--fa-hia.example",
3620 "hostname": "xn--fa-hia.example",
3627 "input": "sc://faß.ExAmPlE/",
3629 "href": "sc://fa%C3%9F.ExAmPlE/",
3634 "host": "fa%C3%9F.ExAmPlE",
3635 "hostname": "fa%C3%9F.ExAmPlE",
3641 "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
3643 "input": "http://%zz%66%a.com",
3644 "base": "http://other.com/",
3647 "If we get an invalid character that has been escaped.",
3649 "input": "http://%25",
3650 "base": "http://other.com/",
3654 "input": "http://hello%00",
3655 "base": "http://other.com/",
3658 "Escaped numbers should be treated like IP addresses if they are.",
3660 "input": "http://%30%78%63%30%2e%30%32%35%30.01",
3661 "base": "http://other.com/",
3662 "href": "http://192.168.0.1/",
3663 "origin": "http://192.168.0.1",
3664 "protocol": "http:",
3667 "host": "192.168.0.1",
3668 "hostname": "192.168.0.1",
3675 "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
3676 "base": "http://other.com/",
3677 "href": "http://192.168.0.1/",
3678 "origin": "http://192.168.0.1",
3679 "protocol": "http:",
3682 "host": "192.168.0.1",
3683 "hostname": "192.168.0.1",
3690 "input": "http://192.168.0.257",
3691 "base": "http://other.com/",
3694 "Invalid escaping in hosts causes failure",
3696 "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
3697 "base": "http://other.com/",
3700 "A space in a host causes failure",
3702 "input": "http://192.168.0.1 hello",
3703 "base": "http://other.com/",
3707 "input": "https://x x:12",
3711 "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
3713 "input": "http://0Xc0.0250.01",
3714 "base": "http://other.com/",
3715 "href": "http://192.168.0.1/",
3716 "origin": "http://192.168.0.1",
3717 "protocol": "http:",
3720 "host": "192.168.0.1",
3721 "hostname": "192.168.0.1",
3727 "Domains with empty labels",
3729 "input": "http://./",
3731 "href": "http://./",
3732 "origin": "http://.",
3733 "protocol": "http:",
3744 "input": "http://../",
3746 "href": "http://../",
3747 "origin": "http://..",
3748 "protocol": "http:",
3758 "Non-special domains with empty labels",
3776 "input": "http://[www.google.com]/",
3781 "input": "http://[google.com]",
3782 "base": "http://other.com/",
3786 "input": "http://[::1.2.3.4x]",
3787 "base": "http://other.com/",
3791 "input": "http://[::1.2.3.]",
3792 "base": "http://other.com/",
3796 "input": "http://[::1.2.]",
3797 "base": "http://other.com/",
3801 "input": "http://[::.1.2]",
3802 "base": "http://other.com/",
3806 "input": "http://[::1.]",
3807 "base": "http://other.com/",
3811 "input": "http://[::.1]",
3812 "base": "http://other.com/",
3816 "input": "http://[::%31]",
3817 "base": "http://other.com/",
3821 "input": "http://%5B::1]",
3822 "base": "http://other.com/",
3827 "input": "http://foo:💩@example.com/bar",
3828 "base": "http://other.com/",
3829 "href": "http://foo:%F0%9F%92%A9@example.com/bar",
3830 "origin": "http://example.com",
3831 "protocol": "http:",
3833 "password": "%F0%9F%92%A9",
3834 "host": "example.com",
3835 "hostname": "example.com",
3841 "# resolving a fragment against any scheme succeeds",
3844 "base": "test:test",
3845 "href": "test:test#",
3847 "protocol": "test:",
3859 "base": "mailto:x@x.com",
3860 "href": "mailto:x@x.com#x",
3862 "protocol": "mailto:",
3868 "pathname": "x@x.com",
3877 "protocol": "data:",
3889 "base": "about:blank",
3890 "href": "about:blank#x",
3892 "protocol": "about:",
3898 "pathname": "blank",
3904 "base": "about:blank",
3905 "href": "about:blank#x:y",
3907 "protocol": "about:",
3913 "pathname": "blank",
3919 "base": "test:test?test",
3920 "href": "test:test?test#",
3922 "protocol": "test:",
3932 "# multiple @ in authority state",
3934 "input": "https://@test@test@example:800/",
3935 "base": "http://doesnotmatter/",
3936 "href": "https://%40test%40test@example:800/",
3937 "origin": "https://example:800",
3938 "protocol": "https:",
3939 "username": "%40test%40test",
3941 "host": "example:800",
3942 "hostname": "example",
3949 "input": "https://@@@example",
3950 "base": "http://doesnotmatter/",
3951 "href": "https://%40%40@example/",
3952 "origin": "https://example",
3953 "protocol": "https:",
3954 "username": "%40%40",
3957 "hostname": "example",
3963 "non-az-09 characters",
3965 "input": "http://`{}:`{}@h/`{}?`{}",
3966 "base": "http://doesnotmatter/",
3967 "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
3968 "origin": "http://h",
3969 "protocol": "http:",
3970 "username": "%60%7B%7D",
3971 "password": "%60%7B%7D",
3975 "pathname": "/%60%7B%7D",
3979 "byte is ' and url is special",
3981 "input": "http://host/?'",
3983 "href": "http://host/?%27",
3984 "origin": "http://host",
3985 "protocol": "http:",
3996 "input": "notspecial://host/?'",
3998 "href": "notspecial://host/?'",
4000 "protocol": "notspecial:",
4010 "# Credentials in base",
4012 "input": "/some/path",
4013 "base": "http://user@example.org/smth",
4014 "href": "http://user@example.org/some/path",
4015 "origin": "http://example.org",
4016 "protocol": "http:",
4019 "host": "example.org",
4020 "hostname": "example.org",
4022 "pathname": "/some/path",
4028 "base": "http://user:pass@example.org:21/smth",
4029 "href": "http://user:pass@example.org:21/smth",
4030 "origin": "http://example.org:21",
4031 "protocol": "http:",
4034 "host": "example.org:21",
4035 "hostname": "example.org",
4037 "pathname": "/smth",
4042 "input": "/some/path",
4043 "base": "http://user:pass@example.org:21/smth",
4044 "href": "http://user:pass@example.org:21/some/path",
4045 "origin": "http://example.org:21",
4046 "protocol": "http:",
4049 "host": "example.org:21",
4050 "hostname": "example.org",
4052 "pathname": "/some/path",
4056 "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
4069 "base": "sc:/pa/pa",
4078 "pathname": "/pa/i",
4084 "base": "sc://ho/pa",
4085 "href": "sc://ho/i",
4099 "base": "sc:///pa/pa",
4100 "href": "sc:///pa/i",
4108 "pathname": "/pa/i",
4124 "base": "sc:/pa/pa",
4139 "base": "sc://ho/pa",
4140 "href": "sc://ho/i",
4154 "base": "sc:///pa/pa",
4179 "base": "sc:/pa/pa",
4194 "base": "sc://ho/pa",
4195 "href": "sc://ho/i",
4209 "base": "sc:///pa/pa",
4234 "base": "sc:/pa/pa",
4235 "href": "sc:/pa/pa?i",
4243 "pathname": "/pa/pa",
4249 "base": "sc://ho/pa",
4250 "href": "sc://ho/pa?i",
4264 "base": "sc:///pa/pa",
4265 "href": "sc:///pa/pa?i",
4273 "pathname": "/pa/pa",
4295 "href": "sc:sd/sd#i",
4303 "pathname": "sd/sd",
4309 "base": "sc:/pa/pa",
4310 "href": "sc:/pa/pa#i",
4318 "pathname": "/pa/pa",
4324 "base": "sc://ho/pa",
4325 "href": "sc://ho/pa#i",
4339 "base": "sc:///pa/pa",
4340 "href": "sc:///pa/pa#i",
4348 "pathname": "/pa/pa",
4352 "# make sure that relative URL logic works on known typically non-relative schemes too",
4354 "input": "data:/../",
4358 "protocol": "data:",
4369 "input": "javascript:/../",
4371 "href": "javascript:/",
4373 "protocol": "javascript:",
4384 "input": "mailto:/../",
4388 "protocol": "mailto:",
4398 "# unknown schemes and their hosts",
4400 "input": "sc://ñ.test/",
4402 "href": "sc://%C3%B1.test/",
4407 "host": "%C3%B1.test",
4408 "hostname": "%C3%B1.test",
4434 "input": "sc://te@s:t@/",
4444 "input": "sc://:12/",
4451 "href": "sc://%C3%B1/x",
4457 "hostname": "%C3%B1",
4463 "# unknown schemes and backslashes",
4465 "input": "sc:\\../",
4475 "pathname": "\\../",
4479 "# unknown scheme with path looking like a password",
4481 "input": "sc::a@example.net",
4483 "href": "sc::a@example.net",
4491 "pathname": ":a@example.net",
4495 "# unknown scheme with bogus percent-encoding",
4497 "input": "wow:%NBD",
4526 "# unknown scheme with non-URL characters",
4528 "input": "wow:\uFFFF",
4530 "href": "wow:%EF%BF%BF",
4538 "pathname": "%EF%BF%BF",
4542 "Forbidden host code points",
4544 "input": "sc://a\u0000b/",
4549 "input": "sc://a b/",
4554 "input": "sc://a<b",
4559 "input": "sc://a>b",
4564 "input": "sc://a[b/",
4569 "input": "sc://a\\b/",
4574 "input": "sc://a]b/",
4579 "input": "sc://a^b",
4584 "input": "sc://a|b/",
4588 "Forbidden host codepoints: tabs and newlines are removed during preprocessing",
4590 "input": "foo://ho\u0009st/",
4595 "href": "foo://host/",
4604 "input": "foo://ho\u000Ast/",
4609 "href": "foo://host/",
4618 "input": "foo://ho\u000Dst/",
4623 "href": "foo://host/",
4631 "Forbidden domain code-points",
4633 "input": "http://a\u0000b/",
4638 "input": "http://a\u0001b/",
4643 "input": "http://a\u0002b/",
4648 "input": "http://a\u0003b/",
4653 "input": "http://a\u0004b/",
4658 "input": "http://a\u0005b/",
4663 "input": "http://a\u0006b/",
4668 "input": "http://a\u0007b/",
4673 "input": "http://a\u0008b/",
4678 "input": "http://a\u000Bb/",
4683 "input": "http://a\u000Cb/",
4688 "input": "http://a\u000Eb/",
4693 "input": "http://a\u000Fb/",
4698 "input": "http://a\u0010b/",
4703 "input": "http://a\u0011b/",
4708 "input": "http://a\u0012b/",
4713 "input": "http://a\u0013b/",
4718 "input": "http://a\u0014b/",
4723 "input": "http://a\u0015b/",
4728 "input": "http://a\u0016b/",
4733 "input": "http://a\u0017b/",
4738 "input": "http://a\u0018b/",
4743 "input": "http://a\u0019b/",
4748 "input": "http://a\u001Ab/",
4753 "input": "http://a\u001Bb/",
4758 "input": "http://a\u001Cb/",
4763 "input": "http://a\u001Db/",
4768 "input": "http://a\u001Eb/",
4773 "input": "http://a\u001Fb/",
4778 "input": "http://a b/",
4783 "input": "http://a%b/",
4788 "input": "http://a<b",
4793 "input": "http://a>b",
4798 "input": "http://a[b/",
4803 "input": "http://a]b/",
4808 "input": "http://a^b",
4813 "input": "http://a|b/",
4818 "input": "http://a\u007Fb/",
4822 "Forbidden domain codepoints: tabs and newlines are removed during preprocessing",
4824 "input": "http://ho\u0009st/",
4829 "href": "http://host/",
4833 "protocol": "http:",
4838 "input": "http://ho\u000Ast/",
4843 "href": "http://host/",
4847 "protocol": "http:",
4852 "input": "http://ho\u000Dst/",
4857 "href": "http://host/",
4861 "protocol": "http:",
4865 "Encoded forbidden domain codepoints in special URLs",
4867 "input": "http://ho%00st/",
4872 "input": "http://ho%01st/",
4877 "input": "http://ho%02st/",
4882 "input": "http://ho%03st/",
4887 "input": "http://ho%04st/",
4892 "input": "http://ho%05st/",
4897 "input": "http://ho%06st/",
4902 "input": "http://ho%07st/",
4907 "input": "http://ho%08st/",
4912 "input": "http://ho%09st/",
4917 "input": "http://ho%0Ast/",
4922 "input": "http://ho%0Bst/",
4927 "input": "http://ho%0Cst/",
4932 "input": "http://ho%0Dst/",
4937 "input": "http://ho%0Est/",
4942 "input": "http://ho%0Fst/",
4947 "input": "http://ho%10st/",
4952 "input": "http://ho%11st/",
4957 "input": "http://ho%12st/",
4962 "input": "http://ho%13st/",
4967 "input": "http://ho%14st/",
4972 "input": "http://ho%15st/",
4977 "input": "http://ho%16st/",
4982 "input": "http://ho%17st/",
4987 "input": "http://ho%18st/",
4992 "input": "http://ho%19st/",
4997 "input": "http://ho%1Ast/",
5002 "input": "http://ho%1Bst/",
5007 "input": "http://ho%1Cst/",
5012 "input": "http://ho%1Dst/",
5017 "input": "http://ho%1Est/",
5022 "input": "http://ho%1Fst/",
5027 "input": "http://ho%20st/",
5032 "input": "http://ho%23st/",
5037 "input": "http://ho%25st/",
5042 "input": "http://ho%2Fst/",
5047 "input": "http://ho%3Ast/",
5052 "input": "http://ho%3Cst/",
5057 "input": "http://ho%3Est/",
5062 "input": "http://ho%3Fst/",
5067 "input": "http://ho%40st/",
5072 "input": "http://ho%5Bst/",
5077 "input": "http://ho%5Cst/",
5082 "input": "http://ho%5Dst/",
5087 "input": "http://ho%7Cst/",
5092 "input": "http://ho%7Fst/",
5096 "Allowed host/domain code points",
5098 "input": "sc://\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F!\"$%&'()*+,-.;=_`{}~/",
5100 "href": "sc://%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~/",
5105 "host": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~",
5106 "hostname": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~",
5112 "# Hosts and percent-encoding",
5114 "input": "ftp://example.com%80/",
5119 "input": "ftp://example.com%A0/",
5124 "input": "https://example.com%80/",
5129 "input": "https://example.com%A0/",
5134 "input": "ftp://%e2%98%83",
5136 "href": "ftp://xn--n3h/",
5137 "origin": "ftp://xn--n3h",
5142 "hostname": "xn--n3h",
5149 "input": "https://%e2%98%83",
5151 "href": "https://xn--n3h/",
5152 "origin": "https://xn--n3h",
5153 "protocol": "https:",
5157 "hostname": "xn--n3h",
5163 "# tests from jsdom/whatwg-url designed for code coverage",
5165 "input": "http://127.0.0.1:10100/relative_import.html",
5167 "href": "http://127.0.0.1:10100/relative_import.html",
5168 "origin": "http://127.0.0.1:10100",
5169 "protocol": "http:",
5172 "host": "127.0.0.1:10100",
5173 "hostname": "127.0.0.1",
5175 "pathname": "/relative_import.html",
5180 "input": "http://facebook.com/?foo=%7B%22abc%22",
5182 "href": "http://facebook.com/?foo=%7B%22abc%22",
5183 "origin": "http://facebook.com",
5184 "protocol": "http:",
5187 "host": "facebook.com",
5188 "hostname": "facebook.com",
5191 "search": "?foo=%7B%22abc%22",
5195 "input": "https://localhost:3000/jqueryui@1.2.3",
5197 "href": "https://localhost:3000/jqueryui@1.2.3",
5198 "origin": "https://localhost:3000",
5199 "protocol": "https:",
5202 "host": "localhost:3000",
5203 "hostname": "localhost",
5205 "pathname": "/jqueryui@1.2.3",
5211 "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
5213 "href": "http://host:9000/path?query#frag",
5214 "origin": "http://host:9000",
5215 "protocol": "http:",
5218 "host": "host:9000",
5221 "pathname": "/path",
5225 "# Stringification of URL.searchParams",
5227 "input": "?a=b&c=d",
5228 "base": "http://example.org/foo/bar",
5229 "href": "http://example.org/foo/bar?a=b&c=d",
5230 "origin": "http://example.org",
5231 "protocol": "http:",
5234 "host": "example.org",
5235 "hostname": "example.org",
5237 "pathname": "/foo/bar",
5238 "search": "?a=b&c=d",
5239 "searchParams": "a=b&c=d",
5243 "input": "??a=b&c=d",
5244 "base": "http://example.org/foo/bar",
5245 "href": "http://example.org/foo/bar??a=b&c=d",
5246 "origin": "http://example.org",
5247 "protocol": "http:",
5250 "host": "example.org",
5251 "hostname": "example.org",
5253 "pathname": "/foo/bar",
5254 "search": "??a=b&c=d",
5255 "searchParams": "%3Fa=b&c=d",
5261 "base": "http://example.org/foo/bar",
5262 "href": "http://example.org/foo/bar",
5263 "origin": "http://example.org",
5264 "protocol": "http:",
5267 "host": "example.org",
5268 "hostname": "example.org",
5270 "pathname": "/foo/bar",
5277 "base": "https://example.org/foo/bar",
5282 "base": "https://example.org/foo/bar",
5296 "# Percent encoding of fragments",
5298 "input": "http://foo.bar/baz?qux#foo\bbar",
5300 "href": "http://foo.bar/baz?qux#foo%08bar",
5301 "origin": "http://foo.bar",
5302 "protocol": "http:",
5306 "hostname": "foo.bar",
5310 "searchParams": "qux=",
5311 "hash": "#foo%08bar"
5314 "input": "http://foo.bar/baz?qux#foo\"bar",
5316 "href": "http://foo.bar/baz?qux#foo%22bar",
5317 "origin": "http://foo.bar",
5318 "protocol": "http:",
5322 "hostname": "foo.bar",
5326 "searchParams": "qux=",
5327 "hash": "#foo%22bar"
5330 "input": "http://foo.bar/baz?qux#foo<bar",
5332 "href": "http://foo.bar/baz?qux#foo%3Cbar",
5333 "origin": "http://foo.bar",
5334 "protocol": "http:",
5338 "hostname": "foo.bar",
5342 "searchParams": "qux=",
5343 "hash": "#foo%3Cbar"
5346 "input": "http://foo.bar/baz?qux#foo>bar",
5348 "href": "http://foo.bar/baz?qux#foo%3Ebar",
5349 "origin": "http://foo.bar",
5350 "protocol": "http:",
5354 "hostname": "foo.bar",
5358 "searchParams": "qux=",
5359 "hash": "#foo%3Ebar"
5362 "input": "http://foo.bar/baz?qux#foo`bar",
5364 "href": "http://foo.bar/baz?qux#foo%60bar",
5365 "origin": "http://foo.bar",
5366 "protocol": "http:",
5370 "hostname": "foo.bar",
5374 "searchParams": "qux=",
5375 "hash": "#foo%60bar"
5377 "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
5379 "input": "http://1.2.3.4/",
5380 "base": "http://other.com/",
5381 "href": "http://1.2.3.4/",
5382 "origin": "http://1.2.3.4",
5383 "protocol": "http:",
5387 "hostname": "1.2.3.4",
5394 "input": "http://1.2.3.4./",
5395 "base": "http://other.com/",
5396 "href": "http://1.2.3.4/",
5397 "origin": "http://1.2.3.4",
5398 "protocol": "http:",
5402 "hostname": "1.2.3.4",
5409 "input": "http://192.168.257",
5410 "base": "http://other.com/",
5411 "href": "http://192.168.1.1/",
5412 "origin": "http://192.168.1.1",
5413 "protocol": "http:",
5416 "host": "192.168.1.1",
5417 "hostname": "192.168.1.1",
5424 "input": "http://192.168.257.",
5425 "base": "http://other.com/",
5426 "href": "http://192.168.1.1/",
5427 "origin": "http://192.168.1.1",
5428 "protocol": "http:",
5431 "host": "192.168.1.1",
5432 "hostname": "192.168.1.1",
5439 "input": "http://192.168.257.com",
5440 "base": "http://other.com/",
5441 "href": "http://192.168.257.com/",
5442 "origin": "http://192.168.257.com",
5443 "protocol": "http:",
5446 "host": "192.168.257.com",
5447 "hostname": "192.168.257.com",
5454 "input": "http://256",
5455 "base": "http://other.com/",
5456 "href": "http://0.0.1.0/",
5457 "origin": "http://0.0.1.0",
5458 "protocol": "http:",
5462 "hostname": "0.0.1.0",
5469 "input": "http://256.com",
5470 "base": "http://other.com/",
5471 "href": "http://256.com/",
5472 "origin": "http://256.com",
5473 "protocol": "http:",
5477 "hostname": "256.com",
5484 "input": "http://999999999",
5485 "base": "http://other.com/",
5486 "href": "http://59.154.201.255/",
5487 "origin": "http://59.154.201.255",
5488 "protocol": "http:",
5491 "host": "59.154.201.255",
5492 "hostname": "59.154.201.255",
5499 "input": "http://999999999.",
5500 "base": "http://other.com/",
5501 "href": "http://59.154.201.255/",
5502 "origin": "http://59.154.201.255",
5503 "protocol": "http:",
5506 "host": "59.154.201.255",
5507 "hostname": "59.154.201.255",
5515 "input": "http://999999999.com",
5516 "base": "http://other.com/",
5517 "href": "http://999999999.com/",
5518 "origin": "http://999999999.com",
5519 "protocol": "http:",
5522 "host": "999999999.com",
5523 "hostname": "999999999.com",
5530 "input": "http://10000000000",
5531 "base": "http://other.com/",
5535 "input": "http://10000000000.com",
5536 "base": "http://other.com/",
5537 "href": "http://10000000000.com/",
5538 "origin": "http://10000000000.com",
5539 "protocol": "http:",
5542 "host": "10000000000.com",
5543 "hostname": "10000000000.com",
5550 "input": "http://4294967295",
5551 "base": "http://other.com/",
5552 "href": "http://255.255.255.255/",
5553 "origin": "http://255.255.255.255",
5554 "protocol": "http:",
5557 "host": "255.255.255.255",
5558 "hostname": "255.255.255.255",
5565 "input": "http://4294967296",
5566 "base": "http://other.com/",
5570 "input": "http://0xffffffff",
5571 "base": "http://other.com/",
5572 "href": "http://255.255.255.255/",
5573 "origin": "http://255.255.255.255",
5574 "protocol": "http:",
5577 "host": "255.255.255.255",
5578 "hostname": "255.255.255.255",
5585 "input": "http://0xffffffff1",
5586 "base": "http://other.com/",
5590 "input": "http://256.256.256.256",
5591 "base": "http://other.com/",
5594 "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)",
5596 "input": "https://0x100000000/test",
5601 "input": "https://256.0.0.1/test",
5605 "# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
5607 "input": "file:///C%3A/",
5609 "href": "file:///C%3A/",
5610 "protocol": "file:",
5616 "pathname": "/C%3A/",
5621 "input": "file:///C%7C/",
5623 "href": "file:///C%7C/",
5624 "protocol": "file:",
5630 "pathname": "/C%7C/",
5635 "input": "file://%43%3A",
5640 "input": "file://%43%7C",
5645 "input": "file://%43|",
5650 "input": "file://C%7C",
5655 "input": "file://%43%7C/",
5660 "input": "https://%43%7C/",
5665 "input": "asdf://%43|/",
5670 "input": "asdf://%43%7C/",
5672 "href": "asdf://%43%7C/",
5674 "protocol": "asdf:",
5678 "hostname": "%43%7C",
5684 "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
5686 "input": "pix/submit.gif",
5687 "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html",
5688 "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
5689 "protocol": "file:",
5695 "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
5701 "base": "file:///C:/",
5702 "href": "file:///C:/",
5703 "protocol": "file:",
5717 "protocol": "file:",
5727 "# More file URL tests by zcorpan and annevk",
5730 "base": "file:///C:/a/b",
5731 "href": "file:///C:/",
5732 "protocol": "file:",
5744 "base": "file://h/C:/a/b",
5745 "href": "file://h/C:/",
5746 "protocol": "file:",
5758 "base": "file://h/a/b",
5759 "href": "file://h/",
5760 "protocol": "file:",
5772 "base": "file:///C:/a/b",
5773 "href": "file:///d:",
5774 "protocol": "file:",
5786 "base": "file:///C:/a/b",
5787 "href": "file:///d:/",
5788 "protocol": "file:",
5800 "base": "file:///ab:/",
5802 "protocol": "file:",
5814 "base": "file:///1:/",
5816 "protocol": "file:",
5828 "base": "file:///test?test#test",
5829 "href": "file:///test?test",
5830 "protocol": "file:",
5836 "pathname": "/test",
5842 "base": "file:///test?test#test",
5843 "href": "file:///test?test",
5844 "protocol": "file:",
5850 "pathname": "/test",
5856 "base": "file:///test?test#test",
5857 "href": "file:///test?x",
5858 "protocol": "file:",
5864 "pathname": "/test",
5870 "base": "file:///test?test#test",
5871 "href": "file:///test?x",
5872 "protocol": "file:",
5878 "pathname": "/test",
5884 "base": "file:///test?test#test",
5885 "href": "file:///test?test#x",
5886 "protocol": "file:",
5892 "pathname": "/test",
5898 "base": "file:///test?test#test",
5899 "href": "file:///test?test#x",
5900 "protocol": "file:",
5906 "pathname": "/test",
5910 "# File URLs and many (back)slashes",
5912 "input": "file:\\\\//",
5914 "href": "file:////",
5915 "protocol": "file:",
5926 "input": "file:\\\\\\\\",
5928 "href": "file:////",
5929 "protocol": "file:",
5940 "input": "file:\\\\\\\\?fox",
5942 "href": "file:////?fox",
5943 "protocol": "file:",
5954 "input": "file:\\\\\\\\#guppy",
5956 "href": "file:////#guppy",
5957 "protocol": "file:",
5968 "input": "file://spider///",
5970 "href": "file://spider///",
5971 "protocol": "file:",
5975 "hostname": "spider",
5982 "input": "file:\\\\localhost//",
5984 "href": "file:////",
5985 "protocol": "file:",
5996 "input": "file:///localhost//cat",
5998 "href": "file:///localhost//cat",
5999 "protocol": "file:",
6005 "pathname": "/localhost//cat",
6010 "input": "file://\\/localhost//cat",
6012 "href": "file:////localhost//cat",
6013 "protocol": "file:",
6019 "pathname": "//localhost//cat",
6024 "input": "file://localhost//a//../..//",
6026 "href": "file://///",
6027 "protocol": "file:",
6038 "input": "/////mouse",
6039 "base": "file:///elephant",
6040 "href": "file://///mouse",
6041 "protocol": "file:",
6047 "pathname": "///mouse",
6053 "base": "file://lion/",
6054 "href": "file:///pig",
6055 "protocol": "file:",
6066 "input": "\\/localhost//pig",
6067 "base": "file://lion/",
6068 "href": "file:////pig",
6069 "protocol": "file:",
6075 "pathname": "//pig",
6080 "input": "//localhost//pig",
6081 "base": "file://lion/",
6082 "href": "file:////pig",
6083 "protocol": "file:",
6089 "pathname": "//pig",
6094 "input": "/..//localhost//pig",
6095 "base": "file://lion/",
6096 "href": "file://lion//localhost//pig",
6097 "protocol": "file:",
6103 "pathname": "//localhost//pig",
6109 "base": "file://ape/",
6111 "protocol": "file:",
6121 "# File URLs with non-empty hosts",
6123 "input": "/rooibos",
6124 "base": "file://tea/",
6125 "href": "file://tea/rooibos",
6126 "protocol": "file:",
6132 "pathname": "/rooibos",
6138 "base": "file://tea/",
6139 "href": "file://tea/?chai",
6140 "protocol": "file:",
6150 "# Windows drive letter handling with the 'file:' base URL",
6153 "base": "file://host/dir/file",
6154 "href": "file://host/C:",
6155 "protocol": "file:",
6167 "base": "file://host/D:/dir1/dir2/file",
6168 "href": "file://host/C:",
6169 "protocol": "file:",
6181 "base": "file://host/dir/file",
6182 "href": "file://host/C:#",
6183 "protocol": "file:",
6195 "base": "file://host/dir/file",
6196 "href": "file://host/C:?",
6197 "protocol": "file:",
6209 "base": "file://host/dir/file",
6210 "href": "file://host/C:/",
6211 "protocol": "file:",
6223 "base": "file://host/dir/file",
6224 "href": "file://host/C:/",
6225 "protocol": "file:",
6237 "base": "file://host/dir/file",
6238 "href": "file://host/C:/",
6239 "protocol": "file:",
6251 "base": "file://host/dir/file",
6252 "href": "file://host/dir/C",
6253 "protocol": "file:",
6259 "pathname": "/dir/C",
6265 "base": "file://host/dir/file",
6266 "href": "file://host/dir/C|a",
6267 "protocol": "file:",
6273 "pathname": "/dir/C|a",
6277 "# Windows drive letter quirk in the file slash state",
6279 "input": "/c:/foo/bar",
6280 "base": "file:///c:/baz/qux",
6281 "href": "file:///c:/foo/bar",
6282 "protocol": "file:",
6288 "pathname": "/c:/foo/bar",
6293 "input": "/c|/foo/bar",
6294 "base": "file:///c:/baz/qux",
6295 "href": "file:///c:/foo/bar",
6296 "protocol": "file:",
6302 "pathname": "/c:/foo/bar",
6307 "input": "file:\\c:\\foo\\bar",
6308 "base": "file:///c:/baz/qux",
6309 "href": "file:///c:/foo/bar",
6310 "protocol": "file:",
6316 "pathname": "/c:/foo/bar",
6321 "input": "/c:/foo/bar",
6322 "base": "file://host/path",
6323 "href": "file://host/c:/foo/bar",
6324 "protocol": "file:",
6330 "pathname": "/c:/foo/bar",
6334 "# Do not drop the host in the presence of a drive letter",
6336 "input": "file://example.net/C:/",
6338 "href": "file://example.net/C:/",
6339 "protocol": "file:",
6342 "host": "example.net",
6343 "hostname": "example.net",
6350 "input": "file://1.2.3.4/C:/",
6352 "href": "file://1.2.3.4/C:/",
6353 "protocol": "file:",
6357 "hostname": "1.2.3.4",
6364 "input": "file://[1::8]/C:/",
6366 "href": "file://[1::8]/C:/",
6367 "protocol": "file:",
6371 "hostname": "[1::8]",
6377 "# Copy the host from the base URL in the following cases",
6380 "base": "file://host/",
6381 "href": "file://host/C:/",
6382 "protocol": "file:",
6394 "base": "file://host/",
6395 "href": "file://host/C:/",
6396 "protocol": "file:",
6407 "input": "file:C:/",
6408 "base": "file://host/",
6409 "href": "file://host/C:/",
6410 "protocol": "file:",
6421 "input": "file:/C:/",
6422 "base": "file://host/",
6423 "href": "file://host/C:/",
6424 "protocol": "file:",
6434 "# Copy the empty host from the input in the following cases",
6437 "base": "file://host/",
6438 "href": "file:///C:/",
6439 "protocol": "file:",
6450 "input": "file://C:/",
6451 "base": "file://host/",
6452 "href": "file:///C:/",
6453 "protocol": "file:",
6465 "base": "file://host/",
6466 "href": "file:///C:/",
6467 "protocol": "file:",
6478 "input": "file:///C:/",
6479 "base": "file://host/",
6480 "href": "file:///C:/",
6481 "protocol": "file:",
6491 "# Windows drive letter quirk (no host)",
6493 "input": "file:/C|/",
6495 "href": "file:///C:/",
6496 "protocol": "file:",
6507 "input": "file://C|/",
6509 "href": "file:///C:/",
6510 "protocol": "file:",
6520 "# file URLs without base URL by Rimas Misevičius",
6525 "protocol": "file:",
6536 "input": "file:?q=v",
6538 "href": "file:///?q=v",
6539 "protocol": "file:",
6550 "input": "file:#frag",
6552 "href": "file:///#frag",
6553 "protocol": "file:",
6563 "# file: drive letter cases from https://crbug.com/1078698",
6565 "input": "file:///Y:",
6567 "href": "file:///Y:",
6568 "protocol": "file:",
6579 "input": "file:///Y:/",
6581 "href": "file:///Y:/",
6582 "protocol": "file:",
6593 "input": "file:///./Y",
6595 "href": "file:///Y",
6596 "protocol": "file:",
6607 "input": "file:///./Y:",
6609 "href": "file:///Y:",
6610 "protocol": "file:",
6621 "input": "\\\\\\.\\Y:",
6624 "relativeTo": "non-opaque-path-base"
6626 "# file: drive letter cases from https://crbug.com/1078698 but lowercased",
6628 "input": "file:///y:",
6630 "href": "file:///y:",
6631 "protocol": "file:",
6642 "input": "file:///y:/",
6644 "href": "file:///y:/",
6645 "protocol": "file:",
6656 "input": "file:///./y",
6658 "href": "file:///y",
6659 "protocol": "file:",
6670 "input": "file:///./y:",
6672 "href": "file:///y:",
6673 "protocol": "file:",
6684 "input": "\\\\\\.\\y:",
6687 "relativeTo": "non-opaque-path-base"
6689 "# Additional file URL tests for (https://github.com/whatwg/url/issues/405)",
6691 "input": "file://localhost//a//../..//foo",
6693 "href": "file://///foo",
6694 "protocol": "file:",
6700 "pathname": "///foo",
6705 "input": "file://localhost////foo",
6707 "href": "file://////foo",
6708 "protocol": "file:",
6714 "pathname": "////foo",
6719 "input": "file:////foo",
6721 "href": "file:////foo",
6722 "protocol": "file:",
6728 "pathname": "//foo",
6733 "input": "file:///one/two",
6735 "href": "file:///one/two",
6736 "protocol": "file:",
6742 "pathname": "/one/two",
6747 "input": "file:////one/two",
6749 "href": "file:////one/two",
6750 "protocol": "file:",
6756 "pathname": "//one/two",
6761 "input": "//one/two",
6763 "href": "file://one/two",
6764 "protocol": "file:",
6775 "input": "///one/two",
6777 "href": "file:///one/two",
6778 "protocol": "file:",
6784 "pathname": "/one/two",
6789 "input": "////one/two",
6791 "href": "file:////one/two",
6792 "protocol": "file:",
6798 "pathname": "//one/two",
6803 "input": "file:///.//",
6804 "base": "file:////",
6805 "href": "file:////",
6806 "protocol": "file:",
6816 "File URL tests for https://github.com/whatwg/url/issues/549",
6818 "input": "file:.//p",
6820 "href": "file:////p",
6821 "protocol": "file:",
6832 "input": "file:/.//p",
6834 "href": "file:////p",
6835 "protocol": "file:",
6847 "input": "http://[1:0::]",
6848 "base": "http://example.net/",
6849 "href": "http://[1::]/",
6850 "origin": "http://[1::]",
6851 "protocol": "http:",
6855 "hostname": "[1::]",
6862 "input": "http://[0:1:2:3:4:5:6:7:8]",
6863 "base": "http://example.net/",
6867 "input": "https://[0::0::0]",
6872 "input": "https://[0:.0]",
6877 "input": "https://[0:0:]",
6882 "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]",
6887 "input": "https://[0:1.00.0.0.0]",
6892 "input": "https://[0:1.290.0.0.0]",
6897 "input": "https://[0:1.23.23]",
6903 "input": "http://?",
6908 "input": "http://#",
6912 "Port overflow (2^32 + 81)",
6914 "input": "http://f:4294967377/c",
6915 "base": "http://example.org/",
6918 "Port overflow (2^64 + 81)",
6920 "input": "http://f:18446744073709551697/c",
6921 "base": "http://example.org/",
6924 "Port overflow (2^128 + 81)",
6926 "input": "http://f:340282366920938463463374607431768211537/c",
6927 "base": "http://example.org/",
6930 "# Non-special-URL path tests",
6934 "href": "sc://%C3%B1",
6940 "hostname": "%C3%B1",
6947 "input": "sc://ñ?x",
6949 "href": "sc://%C3%B1?x",
6955 "hostname": "%C3%B1",
6962 "input": "sc://ñ#x",
6964 "href": "sc://%C3%B1#x",
6970 "hostname": "%C3%B1",
6979 "href": "sc://%C3%B1#x",
6985 "hostname": "%C3%B1",
6994 "href": "sc://%C3%B1?x",
7000 "hostname": "%C3%B1",
7065 "href": "sc:////x/",
7077 "input": "tftp://foobar.com/someconfig;mode=netascii",
7079 "href": "tftp://foobar.com/someconfig;mode=netascii",
7081 "protocol": "tftp:",
7084 "host": "foobar.com",
7085 "hostname": "foobar.com",
7087 "pathname": "/someconfig;mode=netascii",
7092 "input": "telnet://user:pass@foobar.com:23/",
7094 "href": "telnet://user:pass@foobar.com:23/",
7096 "protocol": "telnet:",
7099 "host": "foobar.com:23",
7100 "hostname": "foobar.com",
7107 "input": "ut2004://10.10.10.10:7777/Index.ut2",
7109 "href": "ut2004://10.10.10.10:7777/Index.ut2",
7111 "protocol": "ut2004:",
7114 "host": "10.10.10.10:7777",
7115 "hostname": "10.10.10.10",
7117 "pathname": "/Index.ut2",
7122 "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
7124 "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
7126 "protocol": "redis:",
7129 "host": "somehost:6379",
7130 "hostname": "somehost",
7133 "search": "?baz=bam&qux=baz",
7137 "input": "rsync://foo@host:911/sup",
7139 "href": "rsync://foo@host:911/sup",
7141 "protocol": "rsync:",
7152 "input": "git://github.com/foo/bar.git",
7154 "href": "git://github.com/foo/bar.git",
7159 "host": "github.com",
7160 "hostname": "github.com",
7162 "pathname": "/foo/bar.git",
7167 "input": "irc://myserver.com:6999/channel?passwd",
7169 "href": "irc://myserver.com:6999/channel?passwd",
7174 "host": "myserver.com:6999",
7175 "hostname": "myserver.com",
7177 "pathname": "/channel",
7178 "search": "?passwd",
7182 "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
7184 "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
7189 "host": "fw.example.org:9999",
7190 "hostname": "fw.example.org",
7192 "pathname": "/foo.bar.org",
7193 "search": "?type=TXT",
7197 "input": "ldap://localhost:389/ou=People,o=JNDITutorial",
7199 "href": "ldap://localhost:389/ou=People,o=JNDITutorial",
7201 "protocol": "ldap:",
7204 "host": "localhost:389",
7205 "hostname": "localhost",
7207 "pathname": "/ou=People,o=JNDITutorial",
7212 "input": "git+https://github.com/foo/bar",
7214 "href": "git+https://github.com/foo/bar",
7216 "protocol": "git+https:",
7219 "host": "github.com",
7220 "hostname": "github.com",
7222 "pathname": "/foo/bar",
7227 "input": "urn:ietf:rfc:2648",
7229 "href": "urn:ietf:rfc:2648",
7237 "pathname": "ietf:rfc:2648",
7242 "input": "tag:joe@example.org,2001:foo/bar",
7244 "href": "tag:joe@example.org,2001:foo/bar",
7252 "pathname": "joe@example.org,2001:foo/bar",
7256 "Serialize /. in path",
7258 "input": "non-spec:/.//",
7260 "href": "non-spec:/.//",
7261 "protocol": "non-spec:",
7272 "input": "non-spec:/..//",
7274 "href": "non-spec:/.//",
7275 "protocol": "non-spec:",
7286 "input": "non-spec:/a/..//",
7288 "href": "non-spec:/.//",
7289 "protocol": "non-spec:",
7300 "input": "non-spec:/.//path",
7302 "href": "non-spec:/.//path",
7303 "protocol": "non-spec:",
7309 "pathname": "//path",
7314 "input": "non-spec:/..//path",
7316 "href": "non-spec:/.//path",
7317 "protocol": "non-spec:",
7323 "pathname": "//path",
7328 "input": "non-spec:/a/..//path",
7330 "href": "non-spec:/.//path",
7331 "protocol": "non-spec:",
7337 "pathname": "//path",
7342 "input": "/.//path",
7343 "base": "non-spec:/p",
7344 "href": "non-spec:/.//path",
7345 "protocol": "non-spec:",
7351 "pathname": "//path",
7356 "input": "/..//path",
7357 "base": "non-spec:/p",
7358 "href": "non-spec:/.//path",
7359 "protocol": "non-spec:",
7365 "pathname": "//path",
7370 "input": "..//path",
7371 "base": "non-spec:/p",
7372 "href": "non-spec:/.//path",
7373 "protocol": "non-spec:",
7379 "pathname": "//path",
7384 "input": "a/..//path",
7385 "base": "non-spec:/p",
7386 "href": "non-spec:/.//path",
7387 "protocol": "non-spec:",
7393 "pathname": "//path",
7399 "base": "non-spec:/..//p",
7400 "href": "non-spec:/.//p",
7401 "protocol": "non-spec:",
7413 "base": "non-spec:/..//p",
7414 "href": "non-spec:/.//path",
7415 "protocol": "non-spec:",
7421 "pathname": "//path",
7425 "Do not serialize /. in path",
7428 "base": "non-spec:/.//p",
7429 "href": "non-spec:/path",
7430 "protocol": "non-spec:",
7436 "pathname": "/path",
7440 "# percent encoded hosts in non-special-URLs",
7442 "input": "non-special://%E2%80%A0/",
7444 "href": "non-special://%E2%80%A0/",
7445 "protocol": "non-special:",
7448 "host": "%E2%80%A0",
7449 "hostname": "%E2%80%A0",
7456 "input": "non-special://H%4fSt/path",
7458 "href": "non-special://H%4fSt/path",
7459 "protocol": "non-special:",
7463 "hostname": "H%4fSt",
7465 "pathname": "/path",
7469 "# IPv6 in non-special-URLs",
7471 "input": "non-special://[1:2:0:0:5:0:0:0]/",
7473 "href": "non-special://[1:2:0:0:5::]/",
7474 "protocol": "non-special:",
7477 "host": "[1:2:0:0:5::]",
7478 "hostname": "[1:2:0:0:5::]",
7485 "input": "non-special://[1:2:0:0:0:0:0:3]/",
7487 "href": "non-special://[1:2::3]/",
7488 "protocol": "non-special:",
7492 "hostname": "[1:2::3]",
7499 "input": "non-special://[1:2::3]:80/",
7501 "href": "non-special://[1:2::3]:80/",
7502 "protocol": "non-special:",
7505 "host": "[1:2::3]:80",
7506 "hostname": "[1:2::3]",
7513 "input": "non-special://[:80/",
7518 "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
7520 "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
7522 "protocol": "blob:",
7528 "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
7537 "protocol": "blob:",
7547 "Invalid IPv4 radix digits",
7549 "input": "http://0x7f.0.0.0x7g",
7551 "href": "http://0x7f.0.0.0x7g/",
7552 "protocol": "http:",
7555 "host": "0x7f.0.0.0x7g",
7556 "hostname": "0x7f.0.0.0x7g",
7563 "input": "http://0X7F.0.0.0X7G",
7565 "href": "http://0x7f.0.0.0x7g/",
7566 "protocol": "http:",
7569 "host": "0x7f.0.0.0x7g",
7570 "hostname": "0x7f.0.0.0x7g",
7576 "Invalid IPv4 portion of IPv6 address",
7578 "input": "http://[::127.0.0.0.1]",
7582 "Uncompressed IPv6 addresses with 0",
7584 "input": "http://[0:1:0:1:0:1:0:1]",
7586 "href": "http://[0:1:0:1:0:1:0:1]/",
7587 "protocol": "http:",
7590 "host": "[0:1:0:1:0:1:0:1]",
7591 "hostname": "[0:1:0:1:0:1:0:1]",
7598 "input": "http://[1:0:1:0:1:0:1:0]",
7600 "href": "http://[1:0:1:0:1:0:1:0]/",
7601 "protocol": "http:",
7604 "host": "[1:0:1:0:1:0:1:0]",
7605 "hostname": "[1:0:1:0:1:0:1:0]",
7611 "Percent-encoded query and fragment",
7613 "input": "http://example.org/test?\u0022",
7615 "href": "http://example.org/test?%22",
7616 "protocol": "http:",
7619 "host": "example.org",
7620 "hostname": "example.org",
7622 "pathname": "/test",
7627 "input": "http://example.org/test?\u0023",
7629 "href": "http://example.org/test?#",
7630 "protocol": "http:",
7633 "host": "example.org",
7634 "hostname": "example.org",
7636 "pathname": "/test",
7641 "input": "http://example.org/test?\u003C",
7643 "href": "http://example.org/test?%3C",
7644 "protocol": "http:",
7647 "host": "example.org",
7648 "hostname": "example.org",
7650 "pathname": "/test",
7655 "input": "http://example.org/test?\u003E",
7657 "href": "http://example.org/test?%3E",
7658 "protocol": "http:",
7661 "host": "example.org",
7662 "hostname": "example.org",
7664 "pathname": "/test",
7669 "input": "http://example.org/test?\u2323",
7671 "href": "http://example.org/test?%E2%8C%A3",
7672 "protocol": "http:",
7675 "host": "example.org",
7676 "hostname": "example.org",
7678 "pathname": "/test",
7679 "search": "?%E2%8C%A3",
7683 "input": "http://example.org/test?%23%23",
7685 "href": "http://example.org/test?%23%23",
7686 "protocol": "http:",
7689 "host": "example.org",
7690 "hostname": "example.org",
7692 "pathname": "/test",
7693 "search": "?%23%23",
7697 "input": "http://example.org/test?%GH",
7699 "href": "http://example.org/test?%GH",
7700 "protocol": "http:",
7703 "host": "example.org",
7704 "hostname": "example.org",
7706 "pathname": "/test",
7711 "input": "http://example.org/test?a#%EF",
7713 "href": "http://example.org/test?a#%EF",
7714 "protocol": "http:",
7717 "host": "example.org",
7718 "hostname": "example.org",
7720 "pathname": "/test",
7725 "input": "http://example.org/test?a#%GH",
7727 "href": "http://example.org/test?a#%GH",
7728 "protocol": "http:",
7731 "host": "example.org",
7732 "hostname": "example.org",
7734 "pathname": "/test",
7738 "URLs that require a non-about:blank base. (Also serve as invalid base tests.)",
7743 "relativeTo": "non-opaque-path-base"
7749 "relativeTo": "non-opaque-path-base"
7755 "relativeTo": "non-opaque-path-base"
7757 "Bases that don't fail to parse but fail to be bases",
7759 "input": "test-a-colon.html",
7764 "input": "test-a-colon-b.html",
7768 "Other base URL tests, that must succeed",
7770 "input": "test-a-colon-slash.html",
7772 "href": "a:/test-a-colon-slash.html",
7779 "pathname": "/test-a-colon-slash.html",
7784 "input": "test-a-colon-slash-slash.html",
7786 "href": "a:///test-a-colon-slash-slash.html",
7793 "pathname": "/test-a-colon-slash-slash.html",
7798 "input": "test-a-colon-slash-b.html",
7800 "href": "a:/test-a-colon-slash-b.html",
7807 "pathname": "/test-a-colon-slash-b.html",
7812 "input": "test-a-colon-slash-slash-b.html",
7814 "href": "a://b/test-a-colon-slash-slash-b.html",
7821 "pathname": "/test-a-colon-slash-slash-b.html",
7825 "Null code point in fragment",
7827 "input": "http://example.org/test?a#b\u0000c",
7829 "href": "http://example.org/test?a#b%00c",
7830 "protocol": "http:",
7833 "host": "example.org",
7834 "hostname": "example.org",
7836 "pathname": "/test",
7841 "input": "non-spec://example.org/test?a#b\u0000c",
7843 "href": "non-spec://example.org/test?a#b%00c",
7844 "protocol": "non-spec:",
7847 "host": "example.org",
7848 "hostname": "example.org",
7850 "pathname": "/test",
7855 "input": "non-spec:/test?a#b\u0000c",
7857 "href": "non-spec:/test?a#b%00c",
7858 "protocol": "non-spec:",
7864 "pathname": "/test",
7868 "First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
7870 "input": "10.0.0.7:8080/foo.html",
7871 "base": "file:///some/dir/bar.html",
7872 "href": "file:///some/dir/10.0.0.7:8080/foo.html",
7873 "protocol": "file:",
7879 "pathname": "/some/dir/10.0.0.7:8080/foo.html",
7883 "Subsequent scheme chars - not allowed",
7885 "input": "a!@$*=/foo.html",
7886 "base": "file:///some/dir/bar.html",
7887 "href": "file:///some/dir/a!@$*=/foo.html",
7888 "protocol": "file:",
7894 "pathname": "/some/dir/a!@$*=/foo.html",
7898 "First and subsequent scheme chars - allowed",
7900 "input": "a1234567890-+.:foo/bar",
7901 "base": "http://example.com/dir/file",
7902 "href": "a1234567890-+.:foo/bar",
7903 "protocol": "a1234567890-+.:",
7909 "pathname": "foo/bar",
7913 "IDNA ignored code points in file URLs hosts",
7915 "input": "file://a\u00ADb/p",
7917 "href": "file://ab/p",
7918 "protocol": "file:",
7929 "input": "file://a%C2%ADb/p",
7931 "href": "file://ab/p",
7932 "protocol": "file:",
7942 "IDNA hostnames which get mapped to 'localhost'",
7944 "input": "file://loC𝐀𝐋𝐇𝐨𝐬𝐭/usr/bin",
7946 "href": "file:///usr/bin",
7947 "protocol": "file:",
7953 "pathname": "/usr/bin",
7957 "Empty host after the domain to ASCII",
7959 "input": "file://\u00ad/p",
7964 "input": "file://%C2%AD/p",
7969 "input": "file://xn--/p",
7973 "https://bugzilla.mozilla.org/show_bug.cgi?id=1647058",
7976 "base": "https://example.org/##link",
7977 "href": "https://example.org/#link",
7978 "protocol": "https:",
7981 "host": "example.org",
7982 "hostname": "example.org",
7988 "UTF-8 percent-encode of C0 control percent-encode set and supersets",
7990 "input": "non-special:cannot-be-a-base-url-\u0000\u0001\u001F\u001E\u007E\u007F\u0080",
7995 "href": "non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
7998 "pathname": "cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
8000 "protocol": "non-special:",
8005 "input": "https://www.example.com/path{\u007Fpath.html?query'\u007F=query#fragment<\u007Ffragment",
8007 "hash": "#fragment%3C%7Ffragment",
8008 "host": "www.example.com",
8009 "hostname": "www.example.com",
8010 "href": "https://www.example.com/path%7B%7Fpath.html?query%27%7F=query#fragment%3C%7Ffragment",
8011 "origin": "https://www.example.com",
8013 "pathname": "/path%7B%7Fpath.html",
8015 "protocol": "https:",
8016 "search": "?query%27%7F=query",
8020 "input": "https://user:pass[\u007F@foo/bar",
8021 "base": "http://example.org",
8025 "href": "https://user:pass%5B%7F@foo/bar",
8026 "origin": "https://foo",
8027 "password": "pass%5B%7F",
8030 "protocol": "https:",
8034 "Tests for the distinct percent-encode sets",
8036 "input": "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/",
8041 "href": "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
8048 "username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~"
8051 "input": "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/",
8056 "href": "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/",
8058 "password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~",
8066 "input": "foo://!\"$%&'()*+,-.;=_`{}~/",
8069 "host": "!\"$%&'()*+,-.;=_`{}~",
8070 "hostname": "!\"$%&'()*+,-.;=_`{}~",
8071 "href": "foo://!\"$%&'()*+,-.;=_`{}~/",
8081 "input": "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
8086 "href": "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
8089 "pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
8096 "input": "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
8101 "href": "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8104 "pathname": "/dir/",
8107 "search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8111 "input": "wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
8116 "href": "wss://host/dir/?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8117 "origin": "wss://host",
8119 "pathname": "/dir/",
8122 "search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
8126 "input": "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
8128 "hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
8131 "href": "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
8134 "pathname": "/dir/",
8140 "Ensure that input schemes are not ignored when resolving non-special URLs",
8142 "input": "abc:rootless",
8143 "base": "abc://host/path",
8147 "href": "abc:rootless",
8149 "pathname": "rootless",
8156 "input": "abc:rootless",
8157 "base": "abc:/path",
8161 "href": "abc:rootless",
8163 "pathname": "rootless",
8170 "input": "abc:rootless",
8175 "href": "abc:rootless",
8177 "pathname": "rootless",
8184 "input": "abc:/rooted",
8185 "base": "abc://host/path",
8189 "href": "abc:/rooted",
8191 "pathname": "/rooted",
8197 "Empty query and fragment with blank should throw an error",
8202 "relativeTo": "any-base"
8208 "relativeTo": "non-opaque-path-base"
8210 "Last component looks like a number, but not valid IPv4",
8212 "input": "http://1.2.3.4.5",
8213 "base": "http://other.com/",
8217 "input": "http://1.2.3.4.5.",
8218 "base": "http://other.com/",
8222 "input": "http://0..0x300/",
8227 "input": "http://0..0x300./",
8232 "input": "http://256.256.256.256.256",
8233 "base": "http://other.com/",
8237 "input": "http://256.256.256.256.256.",
8238 "base": "http://other.com/",
8242 "input": "http://1.2.3.08",
8247 "input": "http://1.2.3.08.",
8252 "input": "http://1.2.3.09",
8257 "input": "http://09.2.3.4",
8262 "input": "http://09.2.3.4.",
8267 "input": "http://01.2.3.4.5",
8272 "input": "http://01.2.3.4.5.",
8277 "input": "http://0x100.2.3.4",
8282 "input": "http://0x100.2.3.4.",
8287 "input": "http://0x1.2.3.4.5",
8292 "input": "http://0x1.2.3.4.5.",
8297 "input": "http://foo.1.2.3.4",
8302 "input": "http://foo.1.2.3.4.",
8307 "input": "http://foo.2.3.4",
8312 "input": "http://foo.2.3.4.",
8317 "input": "http://foo.09",
8322 "input": "http://foo.09.",
8327 "input": "http://foo.0x4",
8332 "input": "http://foo.0x4.",
8337 "input": "http://foo.09..",
8341 "hostname": "foo.09..",
8342 "href": "http://foo.09../",
8346 "protocol": "http:",
8351 "input": "http://0999999999999999999/",
8356 "input": "http://foo.0x",
8361 "input": "http://foo.0XFfFfFfFfFfFfFfFfFfAcE123",
8366 "input": "http://💩.123/",
8370 "U+0000 and U+FFFF in various places",
8372 "input": "https://\u0000y",
8377 "input": "https://x/\u0000y",
8382 "href": "https://x/%00y",
8384 "pathname": "/%00y",
8386 "protocol": "https:",
8391 "input": "https://x/?\u0000y",
8396 "href": "https://x/?%00y",
8400 "protocol": "https:",
8405 "input": "https://x/?#\u0000y",
8410 "href": "https://x/?#%00y",
8414 "protocol": "https:",
8419 "input": "https://\uFFFFy",
8424 "input": "https://x/\uFFFFy",
8429 "href": "https://x/%EF%BF%BFy",
8431 "pathname": "/%EF%BF%BFy",
8433 "protocol": "https:",
8438 "input": "https://x/?\uFFFFy",
8443 "href": "https://x/?%EF%BF%BFy",
8447 "protocol": "https:",
8448 "search": "?%EF%BF%BFy",
8452 "input": "https://x/?#\uFFFFy",
8454 "hash": "#%EF%BF%BFy",
8457 "href": "https://x/?#%EF%BF%BFy",
8461 "protocol": "https:",
8466 "input": "non-special:\u0000y",
8471 "href": "non-special:%00y",
8475 "protocol": "non-special:",
8480 "input": "non-special:x/\u0000y",
8485 "href": "non-special:x/%00y",
8487 "pathname": "x/%00y",
8489 "protocol": "non-special:",
8494 "input": "non-special:x/?\u0000y",
8499 "href": "non-special:x/?%00y",
8503 "protocol": "non-special:",
8508 "input": "non-special:x/?#\u0000y",
8513 "href": "non-special:x/?#%00y",
8517 "protocol": "non-special:",
8522 "input": "non-special:\uFFFFy",
8527 "href": "non-special:%EF%BF%BFy",
8529 "pathname": "%EF%BF%BFy",
8531 "protocol": "non-special:",
8536 "input": "non-special:x/\uFFFFy",
8541 "href": "non-special:x/%EF%BF%BFy",
8543 "pathname": "x/%EF%BF%BFy",
8545 "protocol": "non-special:",
8550 "input": "non-special:x/?\uFFFFy",
8555 "href": "non-special:x/?%EF%BF%BFy",
8559 "protocol": "non-special:",
8560 "search": "?%EF%BF%BFy",
8564 "input": "non-special:x/?#\uFFFFy",
8566 "hash": "#%EF%BF%BFy",
8569 "href": "non-special:x/?#%EF%BF%BFy",
8573 "protocol": "non-special:",
8581 "relativeTo": "non-opaque-path-base"
8584 "input": "https://example.com/\"quoted\"",
8587 "host": "example.com",
8588 "hostname": "example.com",
8589 "href": "https://example.com/%22quoted%22",
8590 "origin": "https://example.com",
8592 "pathname": "/%22quoted%22",
8594 "protocol": "https:",
8599 "input": "https://a%C2%ADb/",
8604 "href": "https://ab/",
8605 "origin": "https://ab",
8609 "protocol": "https:",
8614 "comment": "Empty host after domain to ASCII",
8615 "input": "https://\u00AD/",
8620 "input": "https://%C2%AD/",
8625 "input": "https://xn--/",
8629 "Non-special schemes that some implementations might incorrectly treat as special",
8631 "input": "data://example.com:8080/pathname?search#hash",
8633 "href": "data://example.com:8080/pathname?search#hash",
8635 "protocol": "data:",
8638 "host": "example.com:8080",
8639 "hostname": "example.com",
8641 "pathname": "/pathname",
8642 "search": "?search",
8646 "input": "data:///test",
8648 "href": "data:///test",
8650 "protocol": "data:",
8656 "pathname": "/test",
8661 "input": "data://test/a/../b",
8663 "href": "data://test/b",
8665 "protocol": "data:",
8676 "input": "data://:443",
8681 "input": "data://test:test",
8686 "input": "data://[:1]",
8691 "input": "javascript://example.com:8080/pathname?search#hash",
8693 "href": "javascript://example.com:8080/pathname?search#hash",
8695 "protocol": "javascript:",
8698 "host": "example.com:8080",
8699 "hostname": "example.com",
8701 "pathname": "/pathname",
8702 "search": "?search",
8706 "input": "javascript:///test",
8708 "href": "javascript:///test",
8710 "protocol": "javascript:",
8716 "pathname": "/test",
8721 "input": "javascript://test/a/../b",
8723 "href": "javascript://test/b",
8725 "protocol": "javascript:",
8736 "input": "javascript://:443",
8741 "input": "javascript://test:test",
8746 "input": "javascript://[:1]",
8751 "input": "mailto://example.com:8080/pathname?search#hash",
8753 "href": "mailto://example.com:8080/pathname?search#hash",
8755 "protocol": "mailto:",
8758 "host": "example.com:8080",
8759 "hostname": "example.com",
8761 "pathname": "/pathname",
8762 "search": "?search",
8766 "input": "mailto:///test",
8768 "href": "mailto:///test",
8770 "protocol": "mailto:",
8776 "pathname": "/test",
8781 "input": "mailto://test/a/../b",
8783 "href": "mailto://test/b",
8785 "protocol": "mailto:",
8796 "input": "mailto://:443",
8801 "input": "mailto://test:test",
8806 "input": "mailto://[:1]",
8811 "input": "intent://example.com:8080/pathname?search#hash",
8813 "href": "intent://example.com:8080/pathname?search#hash",
8815 "protocol": "intent:",
8818 "host": "example.com:8080",
8819 "hostname": "example.com",
8821 "pathname": "/pathname",
8822 "search": "?search",
8826 "input": "intent:///test",
8828 "href": "intent:///test",
8830 "protocol": "intent:",
8836 "pathname": "/test",
8841 "input": "intent://test/a/../b",
8843 "href": "intent://test/b",
8845 "protocol": "intent:",
8856 "input": "intent://:443",
8861 "input": "intent://test:test",
8866 "input": "intent://[:1]",
8871 "input": "urn://example.com:8080/pathname?search#hash",
8873 "href": "urn://example.com:8080/pathname?search#hash",
8878 "host": "example.com:8080",
8879 "hostname": "example.com",
8881 "pathname": "/pathname",
8882 "search": "?search",
8886 "input": "urn:///test",
8888 "href": "urn:///test",
8896 "pathname": "/test",
8901 "input": "urn://test/a/../b",
8903 "href": "urn://test/b",
8916 "input": "urn://:443",
8921 "input": "urn://test:test",
8926 "input": "urn://[:1]",
8931 "input": "turn://example.com:8080/pathname?search#hash",
8933 "href": "turn://example.com:8080/pathname?search#hash",
8935 "protocol": "turn:",
8938 "host": "example.com:8080",
8939 "hostname": "example.com",
8941 "pathname": "/pathname",
8942 "search": "?search",
8946 "input": "turn:///test",
8948 "href": "turn:///test",
8950 "protocol": "turn:",
8956 "pathname": "/test",
8961 "input": "turn://test/a/../b",
8963 "href": "turn://test/b",
8965 "protocol": "turn:",
8976 "input": "turn://:443",
8981 "input": "turn://test:test",
8986 "input": "turn://[:1]",
8991 "input": "stun://example.com:8080/pathname?search#hash",
8993 "href": "stun://example.com:8080/pathname?search#hash",
8995 "protocol": "stun:",
8998 "host": "example.com:8080",
8999 "hostname": "example.com",
9001 "pathname": "/pathname",
9002 "search": "?search",
9006 "input": "stun:///test",
9008 "href": "stun:///test",
9010 "protocol": "stun:",
9016 "pathname": "/test",
9021 "input": "stun://test/a/../b",
9023 "href": "stun://test/b",
9025 "protocol": "stun:",
9036 "input": "stun://:443",
9041 "input": "stun://test:test",
9046 "input": "stun://[:1]",