1[ 2 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js", 3 { 4 "input": "http://example\t.\norg", 5 "base": "http://example.org/foo/bar", 6 "href": "http://example.org/", 7 "origin": "http://example.org", 8 "protocol": "http:", 9 "username": "", 10 "password": "", 11 "host": "example.org", 12 "hostname": "example.org", 13 "port": "", 14 "pathname": "/", 15 "search": "", 16 "hash": "" 17 }, 18 { 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", 23 "protocol": "http:", 24 "username": "user", 25 "password": "pass", 26 "host": "foo:21", 27 "hostname": "foo", 28 "port": "21", 29 "pathname": "/bar;par", 30 "search": "?b", 31 "hash": "#c" 32 }, 33 { 34 "input": "https://test:@test", 35 "base": "about:blank", 36 "href": "https://test@test/", 37 "origin": "https://test", 38 "protocol": "https:", 39 "username": "test", 40 "password": "", 41 "host": "test", 42 "hostname": "test", 43 "port": "", 44 "pathname": "/", 45 "search": "", 46 "hash": "" 47 }, 48 { 49 "input": "https://:@test", 50 "base": "about:blank", 51 "href": "https://test/", 52 "origin": "https://test", 53 "protocol": "https:", 54 "username": "", 55 "password": "", 56 "host": "test", 57 "hostname": "test", 58 "port": "", 59 "pathname": "/", 60 "search": "", 61 "hash": "" 62 }, 63 { 64 "input": "non-special://test:@test/x", 65 "base": "about:blank", 66 "href": "non-special://test@test/x", 67 "origin": "null", 68 "protocol": "non-special:", 69 "username": "test", 70 "password": "", 71 "host": "test", 72 "hostname": "test", 73 "port": "", 74 "pathname": "/x", 75 "search": "", 76 "hash": "" 77 }, 78 { 79 "input": "non-special://:@test/x", 80 "base": "about:blank", 81 "href": "non-special://test/x", 82 "origin": "null", 83 "protocol": "non-special:", 84 "username": "", 85 "password": "", 86 "host": "test", 87 "hostname": "test", 88 "port": "", 89 "pathname": "/x", 90 "search": "", 91 "hash": "" 92 }, 93 { 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", 98 "protocol": "http:", 99 "username": "", 100 "password": "", 101 "host": "example.org", 102 "hostname": "example.org", 103 "port": "", 104 "pathname": "/foo/foo.com", 105 "search": "", 106 "hash": "" 107 }, 108 { 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", 113 "protocol": "http:", 114 "username": "", 115 "password": "", 116 "host": "example.org", 117 "hostname": "example.org", 118 "port": "", 119 "pathname": "/foo/:foo.com", 120 "search": "", 121 "hash": "" 122 }, 123 { 124 "input": " foo.com ", 125 "base": "http://example.org/foo/bar", 126 "href": "http://example.org/foo/foo.com", 127 "origin": "http://example.org", 128 "protocol": "http:", 129 "username": "", 130 "password": "", 131 "host": "example.org", 132 "hostname": "example.org", 133 "port": "", 134 "pathname": "/foo/foo.com", 135 "search": "", 136 "hash": "" 137 }, 138 { 139 "input": "a:\t foo.com", 140 "base": "http://example.org/foo/bar", 141 "href": "a: foo.com", 142 "origin": "null", 143 "protocol": "a:", 144 "username": "", 145 "password": "", 146 "host": "", 147 "hostname": "", 148 "port": "", 149 "pathname": " foo.com", 150 "search": "", 151 "hash": "" 152 }, 153 { 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", 158 "protocol": "http:", 159 "username": "", 160 "password": "", 161 "host": "f:21", 162 "hostname": "f", 163 "port": "21", 164 "pathname": "/%20b%20", 165 "search": "?%20d%20", 166 "hash": "#%20e" 167 }, 168 { 169 "input": "lolscheme:x x#x x", 170 "base": "about:blank", 171 "href": "lolscheme:x x#x%20x", 172 "protocol": "lolscheme:", 173 "username": "", 174 "password": "", 175 "host": "", 176 "hostname": "", 177 "port": "", 178 "pathname": "x x", 179 "search": "", 180 "hash": "#x%20x" 181 }, 182 { 183 "input": "http://f:/c", 184 "base": "http://example.org/foo/bar", 185 "href": "http://f/c", 186 "origin": "http://f", 187 "protocol": "http:", 188 "username": "", 189 "password": "", 190 "host": "f", 191 "hostname": "f", 192 "port": "", 193 "pathname": "/c", 194 "search": "", 195 "hash": "" 196 }, 197 { 198 "input": "http://f:0/c", 199 "base": "http://example.org/foo/bar", 200 "href": "http://f:0/c", 201 "origin": "http://f:0", 202 "protocol": "http:", 203 "username": "", 204 "password": "", 205 "host": "f:0", 206 "hostname": "f", 207 "port": "0", 208 "pathname": "/c", 209 "search": "", 210 "hash": "" 211 }, 212 { 213 "input": "http://f:00000000000000/c", 214 "base": "http://example.org/foo/bar", 215 "href": "http://f:0/c", 216 "origin": "http://f:0", 217 "protocol": "http:", 218 "username": "", 219 "password": "", 220 "host": "f:0", 221 "hostname": "f", 222 "port": "0", 223 "pathname": "/c", 224 "search": "", 225 "hash": "" 226 }, 227 { 228 "input": "http://f:00000000000000000000080/c", 229 "base": "http://example.org/foo/bar", 230 "href": "http://f/c", 231 "origin": "http://f", 232 "protocol": "http:", 233 "username": "", 234 "password": "", 235 "host": "f", 236 "hostname": "f", 237 "port": "", 238 "pathname": "/c", 239 "search": "", 240 "hash": "" 241 }, 242 { 243 "input": "http://f:b/c", 244 "base": "http://example.org/foo/bar", 245 "failure": true 246 }, 247 { 248 "input": "http://f: /c", 249 "base": "http://example.org/foo/bar", 250 "failure": true 251 }, 252 { 253 "input": "http://f:\n/c", 254 "base": "http://example.org/foo/bar", 255 "href": "http://f/c", 256 "origin": "http://f", 257 "protocol": "http:", 258 "username": "", 259 "password": "", 260 "host": "f", 261 "hostname": "f", 262 "port": "", 263 "pathname": "/c", 264 "search": "", 265 "hash": "" 266 }, 267 { 268 "input": "http://f:fifty-two/c", 269 "base": "http://example.org/foo/bar", 270 "failure": true 271 }, 272 { 273 "input": "http://f:999999/c", 274 "base": "http://example.org/foo/bar", 275 "failure": true 276 }, 277 { 278 "input": "non-special://f:999999/c", 279 "base": "http://example.org/foo/bar", 280 "failure": true 281 }, 282 { 283 "input": "http://f: 21 / b ? d # e ", 284 "base": "http://example.org/foo/bar", 285 "failure": true 286 }, 287 { 288 "input": "", 289 "base": "http://example.org/foo/bar", 290 "href": "http://example.org/foo/bar", 291 "origin": "http://example.org", 292 "protocol": "http:", 293 "username": "", 294 "password": "", 295 "host": "example.org", 296 "hostname": "example.org", 297 "port": "", 298 "pathname": "/foo/bar", 299 "search": "", 300 "hash": "" 301 }, 302 { 303 "input": " \t", 304 "base": "http://example.org/foo/bar", 305 "href": "http://example.org/foo/bar", 306 "origin": "http://example.org", 307 "protocol": "http:", 308 "username": "", 309 "password": "", 310 "host": "example.org", 311 "hostname": "example.org", 312 "port": "", 313 "pathname": "/foo/bar", 314 "search": "", 315 "hash": "" 316 }, 317 { 318 "input": ":foo.com/", 319 "base": "http://example.org/foo/bar", 320 "href": "http://example.org/foo/:foo.com/", 321 "origin": "http://example.org", 322 "protocol": "http:", 323 "username": "", 324 "password": "", 325 "host": "example.org", 326 "hostname": "example.org", 327 "port": "", 328 "pathname": "/foo/:foo.com/", 329 "search": "", 330 "hash": "" 331 }, 332 { 333 "input": ":foo.com\\", 334 "base": "http://example.org/foo/bar", 335 "href": "http://example.org/foo/:foo.com/", 336 "origin": "http://example.org", 337 "protocol": "http:", 338 "username": "", 339 "password": "", 340 "host": "example.org", 341 "hostname": "example.org", 342 "port": "", 343 "pathname": "/foo/:foo.com/", 344 "search": "", 345 "hash": "" 346 }, 347 { 348 "input": ":", 349 "base": "http://example.org/foo/bar", 350 "href": "http://example.org/foo/:", 351 "origin": "http://example.org", 352 "protocol": "http:", 353 "username": "", 354 "password": "", 355 "host": "example.org", 356 "hostname": "example.org", 357 "port": "", 358 "pathname": "/foo/:", 359 "search": "", 360 "hash": "" 361 }, 362 { 363 "input": ":a", 364 "base": "http://example.org/foo/bar", 365 "href": "http://example.org/foo/:a", 366 "origin": "http://example.org", 367 "protocol": "http:", 368 "username": "", 369 "password": "", 370 "host": "example.org", 371 "hostname": "example.org", 372 "port": "", 373 "pathname": "/foo/:a", 374 "search": "", 375 "hash": "" 376 }, 377 { 378 "input": ":/", 379 "base": "http://example.org/foo/bar", 380 "href": "http://example.org/foo/:/", 381 "origin": "http://example.org", 382 "protocol": "http:", 383 "username": "", 384 "password": "", 385 "host": "example.org", 386 "hostname": "example.org", 387 "port": "", 388 "pathname": "/foo/:/", 389 "search": "", 390 "hash": "" 391 }, 392 { 393 "input": ":\\", 394 "base": "http://example.org/foo/bar", 395 "href": "http://example.org/foo/:/", 396 "origin": "http://example.org", 397 "protocol": "http:", 398 "username": "", 399 "password": "", 400 "host": "example.org", 401 "hostname": "example.org", 402 "port": "", 403 "pathname": "/foo/:/", 404 "search": "", 405 "hash": "" 406 }, 407 { 408 "input": ":#", 409 "base": "http://example.org/foo/bar", 410 "href": "http://example.org/foo/:#", 411 "origin": "http://example.org", 412 "protocol": "http:", 413 "username": "", 414 "password": "", 415 "host": "example.org", 416 "hostname": "example.org", 417 "port": "", 418 "pathname": "/foo/:", 419 "search": "", 420 "hash": "" 421 }, 422 { 423 "input": "#", 424 "base": "http://example.org/foo/bar", 425 "href": "http://example.org/foo/bar#", 426 "origin": "http://example.org", 427 "protocol": "http:", 428 "username": "", 429 "password": "", 430 "host": "example.org", 431 "hostname": "example.org", 432 "port": "", 433 "pathname": "/foo/bar", 434 "search": "", 435 "hash": "" 436 }, 437 { 438 "input": "#/", 439 "base": "http://example.org/foo/bar", 440 "href": "http://example.org/foo/bar#/", 441 "origin": "http://example.org", 442 "protocol": "http:", 443 "username": "", 444 "password": "", 445 "host": "example.org", 446 "hostname": "example.org", 447 "port": "", 448 "pathname": "/foo/bar", 449 "search": "", 450 "hash": "#/" 451 }, 452 { 453 "input": "#\\", 454 "base": "http://example.org/foo/bar", 455 "href": "http://example.org/foo/bar#\\", 456 "origin": "http://example.org", 457 "protocol": "http:", 458 "username": "", 459 "password": "", 460 "host": "example.org", 461 "hostname": "example.org", 462 "port": "", 463 "pathname": "/foo/bar", 464 "search": "", 465 "hash": "#\\" 466 }, 467 { 468 "input": "#;?", 469 "base": "http://example.org/foo/bar", 470 "href": "http://example.org/foo/bar#;?", 471 "origin": "http://example.org", 472 "protocol": "http:", 473 "username": "", 474 "password": "", 475 "host": "example.org", 476 "hostname": "example.org", 477 "port": "", 478 "pathname": "/foo/bar", 479 "search": "", 480 "hash": "#;?" 481 }, 482 { 483 "input": "?", 484 "base": "http://example.org/foo/bar", 485 "href": "http://example.org/foo/bar?", 486 "origin": "http://example.org", 487 "protocol": "http:", 488 "username": "", 489 "password": "", 490 "host": "example.org", 491 "hostname": "example.org", 492 "port": "", 493 "pathname": "/foo/bar", 494 "search": "", 495 "hash": "" 496 }, 497 { 498 "input": "/", 499 "base": "http://example.org/foo/bar", 500 "href": "http://example.org/", 501 "origin": "http://example.org", 502 "protocol": "http:", 503 "username": "", 504 "password": "", 505 "host": "example.org", 506 "hostname": "example.org", 507 "port": "", 508 "pathname": "/", 509 "search": "", 510 "hash": "" 511 }, 512 { 513 "input": ":23", 514 "base": "http://example.org/foo/bar", 515 "href": "http://example.org/foo/:23", 516 "origin": "http://example.org", 517 "protocol": "http:", 518 "username": "", 519 "password": "", 520 "host": "example.org", 521 "hostname": "example.org", 522 "port": "", 523 "pathname": "/foo/:23", 524 "search": "", 525 "hash": "" 526 }, 527 { 528 "input": "/:23", 529 "base": "http://example.org/foo/bar", 530 "href": "http://example.org/:23", 531 "origin": "http://example.org", 532 "protocol": "http:", 533 "username": "", 534 "password": "", 535 "host": "example.org", 536 "hostname": "example.org", 537 "port": "", 538 "pathname": "/:23", 539 "search": "", 540 "hash": "" 541 }, 542 { 543 "input": "::", 544 "base": "http://example.org/foo/bar", 545 "href": "http://example.org/foo/::", 546 "origin": "http://example.org", 547 "protocol": "http:", 548 "username": "", 549 "password": "", 550 "host": "example.org", 551 "hostname": "example.org", 552 "port": "", 553 "pathname": "/foo/::", 554 "search": "", 555 "hash": "" 556 }, 557 { 558 "input": "::23", 559 "base": "http://example.org/foo/bar", 560 "href": "http://example.org/foo/::23", 561 "origin": "http://example.org", 562 "protocol": "http:", 563 "username": "", 564 "password": "", 565 "host": "example.org", 566 "hostname": "example.org", 567 "port": "", 568 "pathname": "/foo/::23", 569 "search": "", 570 "hash": "" 571 }, 572 { 573 "input": "foo://", 574 "base": "http://example.org/foo/bar", 575 "href": "foo://", 576 "origin": "null", 577 "protocol": "foo:", 578 "username": "", 579 "password": "", 580 "host": "", 581 "hostname": "", 582 "port": "", 583 "pathname": "", 584 "search": "", 585 "hash": "" 586 }, 587 { 588 "input": "http://a:b@c:29/d", 589 "base": "http://example.org/foo/bar", 590 "href": "http://a:b@c:29/d", 591 "origin": "http://c:29", 592 "protocol": "http:", 593 "username": "a", 594 "password": "b", 595 "host": "c:29", 596 "hostname": "c", 597 "port": "29", 598 "pathname": "/d", 599 "search": "", 600 "hash": "" 601 }, 602 { 603 "input": "http::@c:29", 604 "base": "http://example.org/foo/bar", 605 "href": "http://example.org/foo/:@c:29", 606 "origin": "http://example.org", 607 "protocol": "http:", 608 "username": "", 609 "password": "", 610 "host": "example.org", 611 "hostname": "example.org", 612 "port": "", 613 "pathname": "/foo/:@c:29", 614 "search": "", 615 "hash": "" 616 }, 617 { 618 "input": "http://&a:foo(b]c@d:2/", 619 "base": "http://example.org/foo/bar", 620 "href": "http://&a:foo(b%5Dc@d:2/", 621 "origin": "http://d:2", 622 "protocol": "http:", 623 "username": "&a", 624 "password": "foo(b%5Dc", 625 "host": "d:2", 626 "hostname": "d", 627 "port": "2", 628 "pathname": "/", 629 "search": "", 630 "hash": "" 631 }, 632 { 633 "input": "http://::@c@d:2", 634 "base": "http://example.org/foo/bar", 635 "href": "http://:%3A%40c@d:2/", 636 "origin": "http://d:2", 637 "protocol": "http:", 638 "username": "", 639 "password": "%3A%40c", 640 "host": "d:2", 641 "hostname": "d", 642 "port": "2", 643 "pathname": "/", 644 "search": "", 645 "hash": "" 646 }, 647 { 648 "input": "http://foo.com:b@d/", 649 "base": "http://example.org/foo/bar", 650 "href": "http://foo.com:b@d/", 651 "origin": "http://d", 652 "protocol": "http:", 653 "username": "foo.com", 654 "password": "b", 655 "host": "d", 656 "hostname": "d", 657 "port": "", 658 "pathname": "/", 659 "search": "", 660 "hash": "" 661 }, 662 { 663 "input": "http://foo.com/\\@", 664 "base": "http://example.org/foo/bar", 665 "href": "http://foo.com//@", 666 "origin": "http://foo.com", 667 "protocol": "http:", 668 "username": "", 669 "password": "", 670 "host": "foo.com", 671 "hostname": "foo.com", 672 "port": "", 673 "pathname": "//@", 674 "search": "", 675 "hash": "" 676 }, 677 { 678 "input": "http:\\\\foo.com\\", 679 "base": "http://example.org/foo/bar", 680 "href": "http://foo.com/", 681 "origin": "http://foo.com", 682 "protocol": "http:", 683 "username": "", 684 "password": "", 685 "host": "foo.com", 686 "hostname": "foo.com", 687 "port": "", 688 "pathname": "/", 689 "search": "", 690 "hash": "" 691 }, 692 { 693 "input": "http:\\\\a\\b:c\\d@foo.com\\", 694 "base": "http://example.org/foo/bar", 695 "href": "http://a/b:c/d@foo.com/", 696 "origin": "http://a", 697 "protocol": "http:", 698 "username": "", 699 "password": "", 700 "host": "a", 701 "hostname": "a", 702 "port": "", 703 "pathname": "/b:c/d@foo.com/", 704 "search": "", 705 "hash": "" 706 }, 707 { 708 "input": "foo:/", 709 "base": "http://example.org/foo/bar", 710 "href": "foo:/", 711 "origin": "null", 712 "protocol": "foo:", 713 "username": "", 714 "password": "", 715 "host": "", 716 "hostname": "", 717 "port": "", 718 "pathname": "/", 719 "search": "", 720 "hash": "" 721 }, 722 { 723 "input": "foo:/bar.com/", 724 "base": "http://example.org/foo/bar", 725 "href": "foo:/bar.com/", 726 "origin": "null", 727 "protocol": "foo:", 728 "username": "", 729 "password": "", 730 "host": "", 731 "hostname": "", 732 "port": "", 733 "pathname": "/bar.com/", 734 "search": "", 735 "hash": "" 736 }, 737 { 738 "input": "foo://///////", 739 "base": "http://example.org/foo/bar", 740 "href": "foo://///////", 741 "origin": "null", 742 "protocol": "foo:", 743 "username": "", 744 "password": "", 745 "host": "", 746 "hostname": "", 747 "port": "", 748 "pathname": "///////", 749 "search": "", 750 "hash": "" 751 }, 752 { 753 "input": "foo://///////bar.com/", 754 "base": "http://example.org/foo/bar", 755 "href": "foo://///////bar.com/", 756 "origin": "null", 757 "protocol": "foo:", 758 "username": "", 759 "password": "", 760 "host": "", 761 "hostname": "", 762 "port": "", 763 "pathname": "///////bar.com/", 764 "search": "", 765 "hash": "" 766 }, 767 { 768 "input": "foo:////://///", 769 "base": "http://example.org/foo/bar", 770 "href": "foo:////://///", 771 "origin": "null", 772 "protocol": "foo:", 773 "username": "", 774 "password": "", 775 "host": "", 776 "hostname": "", 777 "port": "", 778 "pathname": "//://///", 779 "search": "", 780 "hash": "" 781 }, 782 { 783 "input": "c:/foo", 784 "base": "http://example.org/foo/bar", 785 "href": "c:/foo", 786 "origin": "null", 787 "protocol": "c:", 788 "username": "", 789 "password": "", 790 "host": "", 791 "hostname": "", 792 "port": "", 793 "pathname": "/foo", 794 "search": "", 795 "hash": "" 796 }, 797 { 798 "input": "//foo/bar", 799 "base": "http://example.org/foo/bar", 800 "href": "http://foo/bar", 801 "origin": "http://foo", 802 "protocol": "http:", 803 "username": "", 804 "password": "", 805 "host": "foo", 806 "hostname": "foo", 807 "port": "", 808 "pathname": "/bar", 809 "search": "", 810 "hash": "" 811 }, 812 { 813 "input": "http://foo/path;a??e#f#g", 814 "base": "http://example.org/foo/bar", 815 "href": "http://foo/path;a??e#f#g", 816 "origin": "http://foo", 817 "protocol": "http:", 818 "username": "", 819 "password": "", 820 "host": "foo", 821 "hostname": "foo", 822 "port": "", 823 "pathname": "/path;a", 824 "search": "??e", 825 "hash": "#f#g" 826 }, 827 { 828 "input": "http://foo/abcd?efgh?ijkl", 829 "base": "http://example.org/foo/bar", 830 "href": "http://foo/abcd?efgh?ijkl", 831 "origin": "http://foo", 832 "protocol": "http:", 833 "username": "", 834 "password": "", 835 "host": "foo", 836 "hostname": "foo", 837 "port": "", 838 "pathname": "/abcd", 839 "search": "?efgh?ijkl", 840 "hash": "" 841 }, 842 { 843 "input": "http://foo/abcd#foo?bar", 844 "base": "http://example.org/foo/bar", 845 "href": "http://foo/abcd#foo?bar", 846 "origin": "http://foo", 847 "protocol": "http:", 848 "username": "", 849 "password": "", 850 "host": "foo", 851 "hostname": "foo", 852 "port": "", 853 "pathname": "/abcd", 854 "search": "", 855 "hash": "#foo?bar" 856 }, 857 { 858 "input": "[61:24:74]:98", 859 "base": "http://example.org/foo/bar", 860 "href": "http://example.org/foo/[61:24:74]:98", 861 "origin": "http://example.org", 862 "protocol": "http:", 863 "username": "", 864 "password": "", 865 "host": "example.org", 866 "hostname": "example.org", 867 "port": "", 868 "pathname": "/foo/[61:24:74]:98", 869 "search": "", 870 "hash": "" 871 }, 872 { 873 "input": "http:[61:27]/:foo", 874 "base": "http://example.org/foo/bar", 875 "href": "http://example.org/foo/[61:27]/:foo", 876 "origin": "http://example.org", 877 "protocol": "http:", 878 "username": "", 879 "password": "", 880 "host": "example.org", 881 "hostname": "example.org", 882 "port": "", 883 "pathname": "/foo/[61:27]/:foo", 884 "search": "", 885 "hash": "" 886 }, 887 { 888 "input": "http://[1::2]:3:4", 889 "base": "http://example.org/foo/bar", 890 "failure": true 891 }, 892 { 893 "input": "http://2001::1", 894 "base": "http://example.org/foo/bar", 895 "failure": true 896 }, 897 { 898 "input": "http://2001::1]", 899 "base": "http://example.org/foo/bar", 900 "failure": true 901 }, 902 { 903 "input": "http://2001::1]:80", 904 "base": "http://example.org/foo/bar", 905 "failure": true 906 }, 907 { 908 "input": "http://[2001::1]", 909 "base": "http://example.org/foo/bar", 910 "href": "http://[2001::1]/", 911 "origin": "http://[2001::1]", 912 "protocol": "http:", 913 "username": "", 914 "password": "", 915 "host": "[2001::1]", 916 "hostname": "[2001::1]", 917 "port": "", 918 "pathname": "/", 919 "search": "", 920 "hash": "" 921 }, 922 { 923 "input": "http://[::127.0.0.1]", 924 "base": "http://example.org/foo/bar", 925 "href": "http://[::7f00:1]/", 926 "origin": "http://[::7f00:1]", 927 "protocol": "http:", 928 "username": "", 929 "password": "", 930 "host": "[::7f00:1]", 931 "hostname": "[::7f00:1]", 932 "port": "", 933 "pathname": "/", 934 "search": "", 935 "hash": "" 936 }, 937 { 938 "input": "http://[0:0:0:0:0:0:13.1.68.3]", 939 "base": "http://example.org/foo/bar", 940 "href": "http://[::d01:4403]/", 941 "origin": "http://[::d01:4403]", 942 "protocol": "http:", 943 "username": "", 944 "password": "", 945 "host": "[::d01:4403]", 946 "hostname": "[::d01:4403]", 947 "port": "", 948 "pathname": "/", 949 "search": "", 950 "hash": "" 951 }, 952 { 953 "input": "http://[2001::1]:80", 954 "base": "http://example.org/foo/bar", 955 "href": "http://[2001::1]/", 956 "origin": "http://[2001::1]", 957 "protocol": "http:", 958 "username": "", 959 "password": "", 960 "host": "[2001::1]", 961 "hostname": "[2001::1]", 962 "port": "", 963 "pathname": "/", 964 "search": "", 965 "hash": "" 966 }, 967 { 968 "input": "http:/example.com/", 969 "base": "http://example.org/foo/bar", 970 "href": "http://example.org/example.com/", 971 "origin": "http://example.org", 972 "protocol": "http:", 973 "username": "", 974 "password": "", 975 "host": "example.org", 976 "hostname": "example.org", 977 "port": "", 978 "pathname": "/example.com/", 979 "search": "", 980 "hash": "" 981 }, 982 { 983 "input": "ftp:/example.com/", 984 "base": "http://example.org/foo/bar", 985 "href": "ftp://example.com/", 986 "origin": "ftp://example.com", 987 "protocol": "ftp:", 988 "username": "", 989 "password": "", 990 "host": "example.com", 991 "hostname": "example.com", 992 "port": "", 993 "pathname": "/", 994 "search": "", 995 "hash": "" 996 }, 997 { 998 "input": "https:/example.com/", 999 "base": "http://example.org/foo/bar", 1000 "href": "https://example.com/", 1001 "origin": "https://example.com", 1002 "protocol": "https:", 1003 "username": "", 1004 "password": "", 1005 "host": "example.com", 1006 "hostname": "example.com", 1007 "port": "", 1008 "pathname": "/", 1009 "search": "", 1010 "hash": "" 1011 }, 1012 { 1013 "input": "madeupscheme:/example.com/", 1014 "base": "http://example.org/foo/bar", 1015 "href": "madeupscheme:/example.com/", 1016 "origin": "null", 1017 "protocol": "madeupscheme:", 1018 "username": "", 1019 "password": "", 1020 "host": "", 1021 "hostname": "", 1022 "port": "", 1023 "pathname": "/example.com/", 1024 "search": "", 1025 "hash": "" 1026 }, 1027 { 1028 "input": "file:/example.com/", 1029 "base": "http://example.org/foo/bar", 1030 "href": "file:///example.com/", 1031 "protocol": "file:", 1032 "username": "", 1033 "password": "", 1034 "host": "", 1035 "hostname": "", 1036 "port": "", 1037 "pathname": "/example.com/", 1038 "search": "", 1039 "hash": "" 1040 }, 1041 { 1042 "input": "file://example:1/", 1043 "base": "about:blank", 1044 "failure": true 1045 }, 1046 { 1047 "input": "file://example:test/", 1048 "base": "about:blank", 1049 "failure": true 1050 }, 1051 { 1052 "input": "file://example%/", 1053 "base": "about:blank", 1054 "failure": true 1055 }, 1056 { 1057 "input": "file://[example]/", 1058 "base": "about:blank", 1059 "failure": true 1060 }, 1061 { 1062 "input": "ftps:/example.com/", 1063 "base": "http://example.org/foo/bar", 1064 "href": "ftps:/example.com/", 1065 "origin": "null", 1066 "protocol": "ftps:", 1067 "username": "", 1068 "password": "", 1069 "host": "", 1070 "hostname": "", 1071 "port": "", 1072 "pathname": "/example.com/", 1073 "search": "", 1074 "hash": "" 1075 }, 1076 { 1077 "input": "gopher:/example.com/", 1078 "base": "http://example.org/foo/bar", 1079 "href": "gopher://example.com/", 1080 "origin": "gopher://example.com", 1081 "protocol": "gopher:", 1082 "username": "", 1083 "password": "", 1084 "host": "example.com", 1085 "hostname": "example.com", 1086 "port": "", 1087 "pathname": "/", 1088 "search": "", 1089 "hash": "" 1090 }, 1091 { 1092 "input": "ws:/example.com/", 1093 "base": "http://example.org/foo/bar", 1094 "href": "ws://example.com/", 1095 "origin": "ws://example.com", 1096 "protocol": "ws:", 1097 "username": "", 1098 "password": "", 1099 "host": "example.com", 1100 "hostname": "example.com", 1101 "port": "", 1102 "pathname": "/", 1103 "search": "", 1104 "hash": "" 1105 }, 1106 { 1107 "input": "wss:/example.com/", 1108 "base": "http://example.org/foo/bar", 1109 "href": "wss://example.com/", 1110 "origin": "wss://example.com", 1111 "protocol": "wss:", 1112 "username": "", 1113 "password": "", 1114 "host": "example.com", 1115 "hostname": "example.com", 1116 "port": "", 1117 "pathname": "/", 1118 "search": "", 1119 "hash": "" 1120 }, 1121 { 1122 "input": "data:/example.com/", 1123 "base": "http://example.org/foo/bar", 1124 "href": "data:/example.com/", 1125 "origin": "null", 1126 "protocol": "data:", 1127 "username": "", 1128 "password": "", 1129 "host": "", 1130 "hostname": "", 1131 "port": "", 1132 "pathname": "/example.com/", 1133 "search": "", 1134 "hash": "" 1135 }, 1136 { 1137 "input": "javascript:/example.com/", 1138 "base": "http://example.org/foo/bar", 1139 "href": "javascript:/example.com/", 1140 "origin": "null", 1141 "protocol": "javascript:", 1142 "username": "", 1143 "password": "", 1144 "host": "", 1145 "hostname": "", 1146 "port": "", 1147 "pathname": "/example.com/", 1148 "search": "", 1149 "hash": "" 1150 }, 1151 { 1152 "input": "mailto:/example.com/", 1153 "base": "http://example.org/foo/bar", 1154 "href": "mailto:/example.com/", 1155 "origin": "null", 1156 "protocol": "mailto:", 1157 "username": "", 1158 "password": "", 1159 "host": "", 1160 "hostname": "", 1161 "port": "", 1162 "pathname": "/example.com/", 1163 "search": "", 1164 "hash": "" 1165 }, 1166 { 1167 "input": "http:example.com/", 1168 "base": "http://example.org/foo/bar", 1169 "href": "http://example.org/foo/example.com/", 1170 "origin": "http://example.org", 1171 "protocol": "http:", 1172 "username": "", 1173 "password": "", 1174 "host": "example.org", 1175 "hostname": "example.org", 1176 "port": "", 1177 "pathname": "/foo/example.com/", 1178 "search": "", 1179 "hash": "" 1180 }, 1181 { 1182 "input": "ftp:example.com/", 1183 "base": "http://example.org/foo/bar", 1184 "href": "ftp://example.com/", 1185 "origin": "ftp://example.com", 1186 "protocol": "ftp:", 1187 "username": "", 1188 "password": "", 1189 "host": "example.com", 1190 "hostname": "example.com", 1191 "port": "", 1192 "pathname": "/", 1193 "search": "", 1194 "hash": "" 1195 }, 1196 { 1197 "input": "https:example.com/", 1198 "base": "http://example.org/foo/bar", 1199 "href": "https://example.com/", 1200 "origin": "https://example.com", 1201 "protocol": "https:", 1202 "username": "", 1203 "password": "", 1204 "host": "example.com", 1205 "hostname": "example.com", 1206 "port": "", 1207 "pathname": "/", 1208 "search": "", 1209 "hash": "" 1210 }, 1211 { 1212 "input": "madeupscheme:example.com/", 1213 "base": "http://example.org/foo/bar", 1214 "href": "madeupscheme:example.com/", 1215 "origin": "null", 1216 "protocol": "madeupscheme:", 1217 "username": "", 1218 "password": "", 1219 "host": "", 1220 "hostname": "", 1221 "port": "", 1222 "pathname": "example.com/", 1223 "search": "", 1224 "hash": "" 1225 }, 1226 { 1227 "input": "ftps:example.com/", 1228 "base": "http://example.org/foo/bar", 1229 "href": "ftps:example.com/", 1230 "origin": "null", 1231 "protocol": "ftps:", 1232 "username": "", 1233 "password": "", 1234 "host": "", 1235 "hostname": "", 1236 "port": "", 1237 "pathname": "example.com/", 1238 "search": "", 1239 "hash": "" 1240 }, 1241 { 1242 "input": "gopher:example.com/", 1243 "base": "http://example.org/foo/bar", 1244 "href": "gopher://example.com/", 1245 "origin": "gopher://example.com", 1246 "protocol": "gopher:", 1247 "username": "", 1248 "password": "", 1249 "host": "example.com", 1250 "hostname": "example.com", 1251 "port": "", 1252 "pathname": "/", 1253 "search": "", 1254 "hash": "" 1255 }, 1256 { 1257 "input": "ws:example.com/", 1258 "base": "http://example.org/foo/bar", 1259 "href": "ws://example.com/", 1260 "origin": "ws://example.com", 1261 "protocol": "ws:", 1262 "username": "", 1263 "password": "", 1264 "host": "example.com", 1265 "hostname": "example.com", 1266 "port": "", 1267 "pathname": "/", 1268 "search": "", 1269 "hash": "" 1270 }, 1271 { 1272 "input": "wss:example.com/", 1273 "base": "http://example.org/foo/bar", 1274 "href": "wss://example.com/", 1275 "origin": "wss://example.com", 1276 "protocol": "wss:", 1277 "username": "", 1278 "password": "", 1279 "host": "example.com", 1280 "hostname": "example.com", 1281 "port": "", 1282 "pathname": "/", 1283 "search": "", 1284 "hash": "" 1285 }, 1286 { 1287 "input": "data:example.com/", 1288 "base": "http://example.org/foo/bar", 1289 "href": "data:example.com/", 1290 "origin": "null", 1291 "protocol": "data:", 1292 "username": "", 1293 "password": "", 1294 "host": "", 1295 "hostname": "", 1296 "port": "", 1297 "pathname": "example.com/", 1298 "search": "", 1299 "hash": "" 1300 }, 1301 { 1302 "input": "javascript:example.com/", 1303 "base": "http://example.org/foo/bar", 1304 "href": "javascript:example.com/", 1305 "origin": "null", 1306 "protocol": "javascript:", 1307 "username": "", 1308 "password": "", 1309 "host": "", 1310 "hostname": "", 1311 "port": "", 1312 "pathname": "example.com/", 1313 "search": "", 1314 "hash": "" 1315 }, 1316 { 1317 "input": "mailto:example.com/", 1318 "base": "http://example.org/foo/bar", 1319 "href": "mailto:example.com/", 1320 "origin": "null", 1321 "protocol": "mailto:", 1322 "username": "", 1323 "password": "", 1324 "host": "", 1325 "hostname": "", 1326 "port": "", 1327 "pathname": "example.com/", 1328 "search": "", 1329 "hash": "" 1330 }, 1331 { 1332 "input": "/a/b/c", 1333 "base": "http://example.org/foo/bar", 1334 "href": "http://example.org/a/b/c", 1335 "origin": "http://example.org", 1336 "protocol": "http:", 1337 "username": "", 1338 "password": "", 1339 "host": "example.org", 1340 "hostname": "example.org", 1341 "port": "", 1342 "pathname": "/a/b/c", 1343 "search": "", 1344 "hash": "" 1345 }, 1346 { 1347 "input": "/a/ /c", 1348 "base": "http://example.org/foo/bar", 1349 "href": "http://example.org/a/%20/c", 1350 "origin": "http://example.org", 1351 "protocol": "http:", 1352 "username": "", 1353 "password": "", 1354 "host": "example.org", 1355 "hostname": "example.org", 1356 "port": "", 1357 "pathname": "/a/%20/c", 1358 "search": "", 1359 "hash": "" 1360 }, 1361 { 1362 "input": "/a%2fc", 1363 "base": "http://example.org/foo/bar", 1364 "href": "http://example.org/a%2fc", 1365 "origin": "http://example.org", 1366 "protocol": "http:", 1367 "username": "", 1368 "password": "", 1369 "host": "example.org", 1370 "hostname": "example.org", 1371 "port": "", 1372 "pathname": "/a%2fc", 1373 "search": "", 1374 "hash": "" 1375 }, 1376 { 1377 "input": "/a/%2f/c", 1378 "base": "http://example.org/foo/bar", 1379 "href": "http://example.org/a/%2f/c", 1380 "origin": "http://example.org", 1381 "protocol": "http:", 1382 "username": "", 1383 "password": "", 1384 "host": "example.org", 1385 "hostname": "example.org", 1386 "port": "", 1387 "pathname": "/a/%2f/c", 1388 "search": "", 1389 "hash": "" 1390 }, 1391 { 1392 "input": "#β", 1393 "base": "http://example.org/foo/bar", 1394 "href": "http://example.org/foo/bar#%CE%B2", 1395 "origin": "http://example.org", 1396 "protocol": "http:", 1397 "username": "", 1398 "password": "", 1399 "host": "example.org", 1400 "hostname": "example.org", 1401 "port": "", 1402 "pathname": "/foo/bar", 1403 "search": "", 1404 "hash": "#%CE%B2" 1405 }, 1406 { 1407 "input": "data:text/html,test#test", 1408 "base": "http://example.org/foo/bar", 1409 "href": "data:text/html,test#test", 1410 "origin": "null", 1411 "protocol": "data:", 1412 "username": "", 1413 "password": "", 1414 "host": "", 1415 "hostname": "", 1416 "port": "", 1417 "pathname": "text/html,test", 1418 "search": "", 1419 "hash": "#test" 1420 }, 1421 { 1422 "input": "tel:1234567890", 1423 "base": "http://example.org/foo/bar", 1424 "href": "tel:1234567890", 1425 "origin": "null", 1426 "protocol": "tel:", 1427 "username": "", 1428 "password": "", 1429 "host": "", 1430 "hostname": "", 1431 "port": "", 1432 "pathname": "1234567890", 1433 "search": "", 1434 "hash": "" 1435 }, 1436 "# Based on https://felixfbecker.github.io/whatwg-url-custom-host-repro/", 1437 { 1438 "input": "ssh://example.com/foo/bar.git", 1439 "base": "http://example.org/", 1440 "href": "ssh://example.com/foo/bar.git", 1441 "origin": "null", 1442 "protocol": "ssh:", 1443 "username": "", 1444 "password": "", 1445 "host": "example.com", 1446 "hostname": "example.com", 1447 "port": "", 1448 "pathname": "/foo/bar.git", 1449 "search": "", 1450 "hash": "" 1451 }, 1452 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html", 1453 { 1454 "input": "file:c:\\foo\\bar.html", 1455 "base": "file:///tmp/mock/path", 1456 "href": "file:///c:/foo/bar.html", 1457 "protocol": "file:", 1458 "username": "", 1459 "password": "", 1460 "host": "", 1461 "hostname": "", 1462 "port": "", 1463 "pathname": "/c:/foo/bar.html", 1464 "search": "", 1465 "hash": "" 1466 }, 1467 { 1468 "input": " File:c|////foo\\bar.html", 1469 "base": "file:///tmp/mock/path", 1470 "href": "file:///c:////foo/bar.html", 1471 "protocol": "file:", 1472 "username": "", 1473 "password": "", 1474 "host": "", 1475 "hostname": "", 1476 "port": "", 1477 "pathname": "/c:////foo/bar.html", 1478 "search": "", 1479 "hash": "" 1480 }, 1481 { 1482 "input": "C|/foo/bar", 1483 "base": "file:///tmp/mock/path", 1484 "href": "file:///C:/foo/bar", 1485 "protocol": "file:", 1486 "username": "", 1487 "password": "", 1488 "host": "", 1489 "hostname": "", 1490 "port": "", 1491 "pathname": "/C:/foo/bar", 1492 "search": "", 1493 "hash": "" 1494 }, 1495 { 1496 "input": "/C|\\foo\\bar", 1497 "base": "file:///tmp/mock/path", 1498 "href": "file:///C:/foo/bar", 1499 "protocol": "file:", 1500 "username": "", 1501 "password": "", 1502 "host": "", 1503 "hostname": "", 1504 "port": "", 1505 "pathname": "/C:/foo/bar", 1506 "search": "", 1507 "hash": "" 1508 }, 1509 { 1510 "input": "//C|/foo/bar", 1511 "base": "file:///tmp/mock/path", 1512 "href": "file:///C:/foo/bar", 1513 "protocol": "file:", 1514 "username": "", 1515 "password": "", 1516 "host": "", 1517 "hostname": "", 1518 "port": "", 1519 "pathname": "/C:/foo/bar", 1520 "search": "", 1521 "hash": "" 1522 }, 1523 { 1524 "input": "//server/file", 1525 "base": "file:///tmp/mock/path", 1526 "href": "file://server/file", 1527 "protocol": "file:", 1528 "username": "", 1529 "password": "", 1530 "host": "server", 1531 "hostname": "server", 1532 "port": "", 1533 "pathname": "/file", 1534 "search": "", 1535 "hash": "" 1536 }, 1537 { 1538 "input": "\\\\server\\file", 1539 "base": "file:///tmp/mock/path", 1540 "href": "file://server/file", 1541 "protocol": "file:", 1542 "username": "", 1543 "password": "", 1544 "host": "server", 1545 "hostname": "server", 1546 "port": "", 1547 "pathname": "/file", 1548 "search": "", 1549 "hash": "" 1550 }, 1551 { 1552 "input": "/\\server/file", 1553 "base": "file:///tmp/mock/path", 1554 "href": "file://server/file", 1555 "protocol": "file:", 1556 "username": "", 1557 "password": "", 1558 "host": "server", 1559 "hostname": "server", 1560 "port": "", 1561 "pathname": "/file", 1562 "search": "", 1563 "hash": "" 1564 }, 1565 { 1566 "input": "file:///foo/bar.txt", 1567 "base": "file:///tmp/mock/path", 1568 "href": "file:///foo/bar.txt", 1569 "protocol": "file:", 1570 "username": "", 1571 "password": "", 1572 "host": "", 1573 "hostname": "", 1574 "port": "", 1575 "pathname": "/foo/bar.txt", 1576 "search": "", 1577 "hash": "" 1578 }, 1579 { 1580 "input": "file:///home/me", 1581 "base": "file:///tmp/mock/path", 1582 "href": "file:///home/me", 1583 "protocol": "file:", 1584 "username": "", 1585 "password": "", 1586 "host": "", 1587 "hostname": "", 1588 "port": "", 1589 "pathname": "/home/me", 1590 "search": "", 1591 "hash": "" 1592 }, 1593 { 1594 "input": "//", 1595 "base": "file:///tmp/mock/path", 1596 "href": "file:///", 1597 "protocol": "file:", 1598 "username": "", 1599 "password": "", 1600 "host": "", 1601 "hostname": "", 1602 "port": "", 1603 "pathname": "/", 1604 "search": "", 1605 "hash": "" 1606 }, 1607 { 1608 "input": "///", 1609 "base": "file:///tmp/mock/path", 1610 "href": "file:///", 1611 "protocol": "file:", 1612 "username": "", 1613 "password": "", 1614 "host": "", 1615 "hostname": "", 1616 "port": "", 1617 "pathname": "/", 1618 "search": "", 1619 "hash": "" 1620 }, 1621 { 1622 "input": "///test", 1623 "base": "file:///tmp/mock/path", 1624 "href": "file:///test", 1625 "protocol": "file:", 1626 "username": "", 1627 "password": "", 1628 "host": "", 1629 "hostname": "", 1630 "port": "", 1631 "pathname": "/test", 1632 "search": "", 1633 "hash": "" 1634 }, 1635 { 1636 "input": "file://test", 1637 "base": "file:///tmp/mock/path", 1638 "href": "file://test/", 1639 "protocol": "file:", 1640 "username": "", 1641 "password": "", 1642 "host": "test", 1643 "hostname": "test", 1644 "port": "", 1645 "pathname": "/", 1646 "search": "", 1647 "hash": "" 1648 }, 1649 { 1650 "input": "file://localhost", 1651 "base": "file:///tmp/mock/path", 1652 "href": "file:///", 1653 "protocol": "file:", 1654 "username": "", 1655 "password": "", 1656 "host": "", 1657 "hostname": "", 1658 "port": "", 1659 "pathname": "/", 1660 "search": "", 1661 "hash": "" 1662 }, 1663 { 1664 "input": "file://localhost/", 1665 "base": "file:///tmp/mock/path", 1666 "href": "file:///", 1667 "protocol": "file:", 1668 "username": "", 1669 "password": "", 1670 "host": "", 1671 "hostname": "", 1672 "port": "", 1673 "pathname": "/", 1674 "search": "", 1675 "hash": "" 1676 }, 1677 { 1678 "input": "file://localhost/test", 1679 "base": "file:///tmp/mock/path", 1680 "href": "file:///test", 1681 "protocol": "file:", 1682 "username": "", 1683 "password": "", 1684 "host": "", 1685 "hostname": "", 1686 "port": "", 1687 "pathname": "/test", 1688 "search": "", 1689 "hash": "" 1690 }, 1691 { 1692 "input": "test", 1693 "base": "file:///tmp/mock/path", 1694 "href": "file:///tmp/mock/test", 1695 "protocol": "file:", 1696 "username": "", 1697 "password": "", 1698 "host": "", 1699 "hostname": "", 1700 "port": "", 1701 "pathname": "/tmp/mock/test", 1702 "search": "", 1703 "hash": "" 1704 }, 1705 { 1706 "input": "file:test", 1707 "base": "file:///tmp/mock/path", 1708 "href": "file:///tmp/mock/test", 1709 "protocol": "file:", 1710 "username": "", 1711 "password": "", 1712 "host": "", 1713 "hostname": "", 1714 "port": "", 1715 "pathname": "/tmp/mock/test", 1716 "search": "", 1717 "hash": "" 1718 }, 1719 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js", 1720 { 1721 "input": "http://example.com/././foo", 1722 "base": "about:blank", 1723 "href": "http://example.com/foo", 1724 "origin": "http://example.com", 1725 "protocol": "http:", 1726 "username": "", 1727 "password": "", 1728 "host": "example.com", 1729 "hostname": "example.com", 1730 "port": "", 1731 "pathname": "/foo", 1732 "search": "", 1733 "hash": "" 1734 }, 1735 { 1736 "input": "http://example.com/./.foo", 1737 "base": "about:blank", 1738 "href": "http://example.com/.foo", 1739 "origin": "http://example.com", 1740 "protocol": "http:", 1741 "username": "", 1742 "password": "", 1743 "host": "example.com", 1744 "hostname": "example.com", 1745 "port": "", 1746 "pathname": "/.foo", 1747 "search": "", 1748 "hash": "" 1749 }, 1750 { 1751 "input": "http://example.com/foo/.", 1752 "base": "about:blank", 1753 "href": "http://example.com/foo/", 1754 "origin": "http://example.com", 1755 "protocol": "http:", 1756 "username": "", 1757 "password": "", 1758 "host": "example.com", 1759 "hostname": "example.com", 1760 "port": "", 1761 "pathname": "/foo/", 1762 "search": "", 1763 "hash": "" 1764 }, 1765 { 1766 "input": "http://example.com/foo/./", 1767 "base": "about:blank", 1768 "href": "http://example.com/foo/", 1769 "origin": "http://example.com", 1770 "protocol": "http:", 1771 "username": "", 1772 "password": "", 1773 "host": "example.com", 1774 "hostname": "example.com", 1775 "port": "", 1776 "pathname": "/foo/", 1777 "search": "", 1778 "hash": "" 1779 }, 1780 { 1781 "input": "http://example.com/foo/bar/..", 1782 "base": "about:blank", 1783 "href": "http://example.com/foo/", 1784 "origin": "http://example.com", 1785 "protocol": "http:", 1786 "username": "", 1787 "password": "", 1788 "host": "example.com", 1789 "hostname": "example.com", 1790 "port": "", 1791 "pathname": "/foo/", 1792 "search": "", 1793 "hash": "" 1794 }, 1795 { 1796 "input": "http://example.com/foo/bar/../", 1797 "base": "about:blank", 1798 "href": "http://example.com/foo/", 1799 "origin": "http://example.com", 1800 "protocol": "http:", 1801 "username": "", 1802 "password": "", 1803 "host": "example.com", 1804 "hostname": "example.com", 1805 "port": "", 1806 "pathname": "/foo/", 1807 "search": "", 1808 "hash": "" 1809 }, 1810 { 1811 "input": "http://example.com/foo/..bar", 1812 "base": "about:blank", 1813 "href": "http://example.com/foo/..bar", 1814 "origin": "http://example.com", 1815 "protocol": "http:", 1816 "username": "", 1817 "password": "", 1818 "host": "example.com", 1819 "hostname": "example.com", 1820 "port": "", 1821 "pathname": "/foo/..bar", 1822 "search": "", 1823 "hash": "" 1824 }, 1825 { 1826 "input": "http://example.com/foo/bar/../ton", 1827 "base": "about:blank", 1828 "href": "http://example.com/foo/ton", 1829 "origin": "http://example.com", 1830 "protocol": "http:", 1831 "username": "", 1832 "password": "", 1833 "host": "example.com", 1834 "hostname": "example.com", 1835 "port": "", 1836 "pathname": "/foo/ton", 1837 "search": "", 1838 "hash": "" 1839 }, 1840 { 1841 "input": "http://example.com/foo/bar/../ton/../../a", 1842 "base": "about:blank", 1843 "href": "http://example.com/a", 1844 "origin": "http://example.com", 1845 "protocol": "http:", 1846 "username": "", 1847 "password": "", 1848 "host": "example.com", 1849 "hostname": "example.com", 1850 "port": "", 1851 "pathname": "/a", 1852 "search": "", 1853 "hash": "" 1854 }, 1855 { 1856 "input": "http://example.com/foo/../../..", 1857 "base": "about:blank", 1858 "href": "http://example.com/", 1859 "origin": "http://example.com", 1860 "protocol": "http:", 1861 "username": "", 1862 "password": "", 1863 "host": "example.com", 1864 "hostname": "example.com", 1865 "port": "", 1866 "pathname": "/", 1867 "search": "", 1868 "hash": "" 1869 }, 1870 { 1871 "input": "http://example.com/foo/../../../ton", 1872 "base": "about:blank", 1873 "href": "http://example.com/ton", 1874 "origin": "http://example.com", 1875 "protocol": "http:", 1876 "username": "", 1877 "password": "", 1878 "host": "example.com", 1879 "hostname": "example.com", 1880 "port": "", 1881 "pathname": "/ton", 1882 "search": "", 1883 "hash": "" 1884 }, 1885 { 1886 "input": "http://example.com/foo/%2e", 1887 "base": "about:blank", 1888 "href": "http://example.com/foo/", 1889 "origin": "http://example.com", 1890 "protocol": "http:", 1891 "username": "", 1892 "password": "", 1893 "host": "example.com", 1894 "hostname": "example.com", 1895 "port": "", 1896 "pathname": "/foo/", 1897 "search": "", 1898 "hash": "" 1899 }, 1900 { 1901 "input": "http://example.com/foo/%2e%2", 1902 "base": "about:blank", 1903 "href": "http://example.com/foo/%2e%2", 1904 "origin": "http://example.com", 1905 "protocol": "http:", 1906 "username": "", 1907 "password": "", 1908 "host": "example.com", 1909 "hostname": "example.com", 1910 "port": "", 1911 "pathname": "/foo/%2e%2", 1912 "search": "", 1913 "hash": "" 1914 }, 1915 { 1916 "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar", 1917 "base": "about:blank", 1918 "href": "http://example.com/%2e.bar", 1919 "origin": "http://example.com", 1920 "protocol": "http:", 1921 "username": "", 1922 "password": "", 1923 "host": "example.com", 1924 "hostname": "example.com", 1925 "port": "", 1926 "pathname": "/%2e.bar", 1927 "search": "", 1928 "hash": "" 1929 }, 1930 { 1931 "input": "http://example.com////../..", 1932 "base": "about:blank", 1933 "href": "http://example.com//", 1934 "origin": "http://example.com", 1935 "protocol": "http:", 1936 "username": "", 1937 "password": "", 1938 "host": "example.com", 1939 "hostname": "example.com", 1940 "port": "", 1941 "pathname": "//", 1942 "search": "", 1943 "hash": "" 1944 }, 1945 { 1946 "input": "http://example.com/foo/bar//../..", 1947 "base": "about:blank", 1948 "href": "http://example.com/foo/", 1949 "origin": "http://example.com", 1950 "protocol": "http:", 1951 "username": "", 1952 "password": "", 1953 "host": "example.com", 1954 "hostname": "example.com", 1955 "port": "", 1956 "pathname": "/foo/", 1957 "search": "", 1958 "hash": "" 1959 }, 1960 { 1961 "input": "http://example.com/foo/bar//..", 1962 "base": "about:blank", 1963 "href": "http://example.com/foo/bar/", 1964 "origin": "http://example.com", 1965 "protocol": "http:", 1966 "username": "", 1967 "password": "", 1968 "host": "example.com", 1969 "hostname": "example.com", 1970 "port": "", 1971 "pathname": "/foo/bar/", 1972 "search": "", 1973 "hash": "" 1974 }, 1975 { 1976 "input": "http://example.com/foo", 1977 "base": "about:blank", 1978 "href": "http://example.com/foo", 1979 "origin": "http://example.com", 1980 "protocol": "http:", 1981 "username": "", 1982 "password": "", 1983 "host": "example.com", 1984 "hostname": "example.com", 1985 "port": "", 1986 "pathname": "/foo", 1987 "search": "", 1988 "hash": "" 1989 }, 1990 { 1991 "input": "http://example.com/%20foo", 1992 "base": "about:blank", 1993 "href": "http://example.com/%20foo", 1994 "origin": "http://example.com", 1995 "protocol": "http:", 1996 "username": "", 1997 "password": "", 1998 "host": "example.com", 1999 "hostname": "example.com", 2000 "port": "", 2001 "pathname": "/%20foo", 2002 "search": "", 2003 "hash": "" 2004 }, 2005 { 2006 "input": "http://example.com/foo%", 2007 "base": "about:blank", 2008 "href": "http://example.com/foo%", 2009 "origin": "http://example.com", 2010 "protocol": "http:", 2011 "username": "", 2012 "password": "", 2013 "host": "example.com", 2014 "hostname": "example.com", 2015 "port": "", 2016 "pathname": "/foo%", 2017 "search": "", 2018 "hash": "" 2019 }, 2020 { 2021 "input": "http://example.com/foo%2", 2022 "base": "about:blank", 2023 "href": "http://example.com/foo%2", 2024 "origin": "http://example.com", 2025 "protocol": "http:", 2026 "username": "", 2027 "password": "", 2028 "host": "example.com", 2029 "hostname": "example.com", 2030 "port": "", 2031 "pathname": "/foo%2", 2032 "search": "", 2033 "hash": "" 2034 }, 2035 { 2036 "input": "http://example.com/foo%2zbar", 2037 "base": "about:blank", 2038 "href": "http://example.com/foo%2zbar", 2039 "origin": "http://example.com", 2040 "protocol": "http:", 2041 "username": "", 2042 "password": "", 2043 "host": "example.com", 2044 "hostname": "example.com", 2045 "port": "", 2046 "pathname": "/foo%2zbar", 2047 "search": "", 2048 "hash": "" 2049 }, 2050 { 2051 "input": "http://example.com/foo%2©zbar", 2052 "base": "about:blank", 2053 "href": "http://example.com/foo%2%C3%82%C2%A9zbar", 2054 "origin": "http://example.com", 2055 "protocol": "http:", 2056 "username": "", 2057 "password": "", 2058 "host": "example.com", 2059 "hostname": "example.com", 2060 "port": "", 2061 "pathname": "/foo%2%C3%82%C2%A9zbar", 2062 "search": "", 2063 "hash": "" 2064 }, 2065 { 2066 "input": "http://example.com/foo%41%7a", 2067 "base": "about:blank", 2068 "href": "http://example.com/foo%41%7a", 2069 "origin": "http://example.com", 2070 "protocol": "http:", 2071 "username": "", 2072 "password": "", 2073 "host": "example.com", 2074 "hostname": "example.com", 2075 "port": "", 2076 "pathname": "/foo%41%7a", 2077 "search": "", 2078 "hash": "" 2079 }, 2080 { 2081 "input": "http://example.com/foo\t\u0091%91", 2082 "base": "about:blank", 2083 "href": "http://example.com/foo%C2%91%91", 2084 "origin": "http://example.com", 2085 "protocol": "http:", 2086 "username": "", 2087 "password": "", 2088 "host": "example.com", 2089 "hostname": "example.com", 2090 "port": "", 2091 "pathname": "/foo%C2%91%91", 2092 "search": "", 2093 "hash": "" 2094 }, 2095 { 2096 "input": "http://example.com/foo%00%51", 2097 "base": "about:blank", 2098 "href": "http://example.com/foo%00%51", 2099 "origin": "http://example.com", 2100 "protocol": "http:", 2101 "username": "", 2102 "password": "", 2103 "host": "example.com", 2104 "hostname": "example.com", 2105 "port": "", 2106 "pathname": "/foo%00%51", 2107 "search": "", 2108 "hash": "" 2109 }, 2110 { 2111 "input": "http://example.com/(%28:%3A%29)", 2112 "base": "about:blank", 2113 "href": "http://example.com/(%28:%3A%29)", 2114 "origin": "http://example.com", 2115 "protocol": "http:", 2116 "username": "", 2117 "password": "", 2118 "host": "example.com", 2119 "hostname": "example.com", 2120 "port": "", 2121 "pathname": "/(%28:%3A%29)", 2122 "search": "", 2123 "hash": "" 2124 }, 2125 { 2126 "input": "http://example.com/%3A%3a%3C%3c", 2127 "base": "about:blank", 2128 "href": "http://example.com/%3A%3a%3C%3c", 2129 "origin": "http://example.com", 2130 "protocol": "http:", 2131 "username": "", 2132 "password": "", 2133 "host": "example.com", 2134 "hostname": "example.com", 2135 "port": "", 2136 "pathname": "/%3A%3a%3C%3c", 2137 "search": "", 2138 "hash": "" 2139 }, 2140 { 2141 "input": "http://example.com/foo\tbar", 2142 "base": "about:blank", 2143 "href": "http://example.com/foobar", 2144 "origin": "http://example.com", 2145 "protocol": "http:", 2146 "username": "", 2147 "password": "", 2148 "host": "example.com", 2149 "hostname": "example.com", 2150 "port": "", 2151 "pathname": "/foobar", 2152 "search": "", 2153 "hash": "" 2154 }, 2155 { 2156 "input": "http://example.com\\\\foo\\\\bar", 2157 "base": "about:blank", 2158 "href": "http://example.com//foo//bar", 2159 "origin": "http://example.com", 2160 "protocol": "http:", 2161 "username": "", 2162 "password": "", 2163 "host": "example.com", 2164 "hostname": "example.com", 2165 "port": "", 2166 "pathname": "//foo//bar", 2167 "search": "", 2168 "hash": "" 2169 }, 2170 { 2171 "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", 2172 "base": "about:blank", 2173 "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd", 2174 "origin": "http://example.com", 2175 "protocol": "http:", 2176 "username": "", 2177 "password": "", 2178 "host": "example.com", 2179 "hostname": "example.com", 2180 "port": "", 2181 "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd", 2182 "search": "", 2183 "hash": "" 2184 }, 2185 { 2186 "input": "http://example.com/@asdf%40", 2187 "base": "about:blank", 2188 "href": "http://example.com/@asdf%40", 2189 "origin": "http://example.com", 2190 "protocol": "http:", 2191 "username": "", 2192 "password": "", 2193 "host": "example.com", 2194 "hostname": "example.com", 2195 "port": "", 2196 "pathname": "/@asdf%40", 2197 "search": "", 2198 "hash": "" 2199 }, 2200 { 2201 "input": "http://example.com/你好你好", 2202 "base": "about:blank", 2203 "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", 2204 "origin": "http://example.com", 2205 "protocol": "http:", 2206 "username": "", 2207 "password": "", 2208 "host": "example.com", 2209 "hostname": "example.com", 2210 "port": "", 2211 "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD", 2212 "search": "", 2213 "hash": "" 2214 }, 2215 { 2216 "input": "http://example.com/‥/foo", 2217 "base": "about:blank", 2218 "href": "http://example.com/%E2%80%A5/foo", 2219 "origin": "http://example.com", 2220 "protocol": "http:", 2221 "username": "", 2222 "password": "", 2223 "host": "example.com", 2224 "hostname": "example.com", 2225 "port": "", 2226 "pathname": "/%E2%80%A5/foo", 2227 "search": "", 2228 "hash": "" 2229 }, 2230 { 2231 "input": "http://example.com//foo", 2232 "base": "about:blank", 2233 "href": "http://example.com/%EF%BB%BF/foo", 2234 "origin": "http://example.com", 2235 "protocol": "http:", 2236 "username": "", 2237 "password": "", 2238 "host": "example.com", 2239 "hostname": "example.com", 2240 "port": "", 2241 "pathname": "/%EF%BB%BF/foo", 2242 "search": "", 2243 "hash": "" 2244 }, 2245 { 2246 "input": "http://example.com//foo//bar", 2247 "base": "about:blank", 2248 "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar", 2249 "origin": "http://example.com", 2250 "protocol": "http:", 2251 "username": "", 2252 "password": "", 2253 "host": "example.com", 2254 "hostname": "example.com", 2255 "port": "", 2256 "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar", 2257 "search": "", 2258 "hash": "" 2259 }, 2260 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js", 2261 { 2262 "input": "http://www.google.com/foo?bar=baz#", 2263 "base": "about:blank", 2264 "href": "http://www.google.com/foo?bar=baz#", 2265 "origin": "http://www.google.com", 2266 "protocol": "http:", 2267 "username": "", 2268 "password": "", 2269 "host": "www.google.com", 2270 "hostname": "www.google.com", 2271 "port": "", 2272 "pathname": "/foo", 2273 "search": "?bar=baz", 2274 "hash": "" 2275 }, 2276 { 2277 "input": "http://www.google.com/foo?bar=baz# »", 2278 "base": "about:blank", 2279 "href": "http://www.google.com/foo?bar=baz#%20%C2%BB", 2280 "origin": "http://www.google.com", 2281 "protocol": "http:", 2282 "username": "", 2283 "password": "", 2284 "host": "www.google.com", 2285 "hostname": "www.google.com", 2286 "port": "", 2287 "pathname": "/foo", 2288 "search": "?bar=baz", 2289 "hash": "#%20%C2%BB" 2290 }, 2291 { 2292 "input": "data:test# »", 2293 "base": "about:blank", 2294 "href": "data:test#%20%C2%BB", 2295 "origin": "null", 2296 "protocol": "data:", 2297 "username": "", 2298 "password": "", 2299 "host": "", 2300 "hostname": "", 2301 "port": "", 2302 "pathname": "test", 2303 "search": "", 2304 "hash": "#%20%C2%BB" 2305 }, 2306 { 2307 "input": "http://www.google.com", 2308 "base": "about:blank", 2309 "href": "http://www.google.com/", 2310 "origin": "http://www.google.com", 2311 "protocol": "http:", 2312 "username": "", 2313 "password": "", 2314 "host": "www.google.com", 2315 "hostname": "www.google.com", 2316 "port": "", 2317 "pathname": "/", 2318 "search": "", 2319 "hash": "" 2320 }, 2321 { 2322 "input": "http://192.0x00A80001", 2323 "base": "about:blank", 2324 "href": "http://192.168.0.1/", 2325 "origin": "http://192.168.0.1", 2326 "protocol": "http:", 2327 "username": "", 2328 "password": "", 2329 "host": "192.168.0.1", 2330 "hostname": "192.168.0.1", 2331 "port": "", 2332 "pathname": "/", 2333 "search": "", 2334 "hash": "" 2335 }, 2336 { 2337 "input": "http://www/foo%2Ehtml", 2338 "base": "about:blank", 2339 "href": "http://www/foo%2Ehtml", 2340 "origin": "http://www", 2341 "protocol": "http:", 2342 "username": "", 2343 "password": "", 2344 "host": "www", 2345 "hostname": "www", 2346 "port": "", 2347 "pathname": "/foo%2Ehtml", 2348 "search": "", 2349 "hash": "" 2350 }, 2351 { 2352 "input": "http://www/foo/%2E/html", 2353 "base": "about:blank", 2354 "href": "http://www/foo/html", 2355 "origin": "http://www", 2356 "protocol": "http:", 2357 "username": "", 2358 "password": "", 2359 "host": "www", 2360 "hostname": "www", 2361 "port": "", 2362 "pathname": "/foo/html", 2363 "search": "", 2364 "hash": "" 2365 }, 2366 { 2367 "input": "http://user:pass@/", 2368 "base": "about:blank", 2369 "failure": true 2370 }, 2371 { 2372 "input": "http://%25DOMAIN:foobar@foodomain.com/", 2373 "base": "about:blank", 2374 "href": "http://%25DOMAIN:foobar@foodomain.com/", 2375 "origin": "http://foodomain.com", 2376 "protocol": "http:", 2377 "username": "%25DOMAIN", 2378 "password": "foobar", 2379 "host": "foodomain.com", 2380 "hostname": "foodomain.com", 2381 "port": "", 2382 "pathname": "/", 2383 "search": "", 2384 "hash": "" 2385 }, 2386 { 2387 "input": "http:\\\\www.google.com\\foo", 2388 "base": "about:blank", 2389 "href": "http://www.google.com/foo", 2390 "origin": "http://www.google.com", 2391 "protocol": "http:", 2392 "username": "", 2393 "password": "", 2394 "host": "www.google.com", 2395 "hostname": "www.google.com", 2396 "port": "", 2397 "pathname": "/foo", 2398 "search": "", 2399 "hash": "" 2400 }, 2401 { 2402 "input": "http://foo:80/", 2403 "base": "about:blank", 2404 "href": "http://foo/", 2405 "origin": "http://foo", 2406 "protocol": "http:", 2407 "username": "", 2408 "password": "", 2409 "host": "foo", 2410 "hostname": "foo", 2411 "port": "", 2412 "pathname": "/", 2413 "search": "", 2414 "hash": "" 2415 }, 2416 { 2417 "input": "http://foo:81/", 2418 "base": "about:blank", 2419 "href": "http://foo:81/", 2420 "origin": "http://foo:81", 2421 "protocol": "http:", 2422 "username": "", 2423 "password": "", 2424 "host": "foo:81", 2425 "hostname": "foo", 2426 "port": "81", 2427 "pathname": "/", 2428 "search": "", 2429 "hash": "" 2430 }, 2431 { 2432 "input": "httpa://foo:80/", 2433 "base": "about:blank", 2434 "href": "httpa://foo:80/", 2435 "origin": "null", 2436 "protocol": "httpa:", 2437 "username": "", 2438 "password": "", 2439 "host": "foo:80", 2440 "hostname": "foo", 2441 "port": "80", 2442 "pathname": "/", 2443 "search": "", 2444 "hash": "" 2445 }, 2446 { 2447 "input": "http://foo:-80/", 2448 "base": "about:blank", 2449 "failure": true 2450 }, 2451 { 2452 "input": "https://foo:443/", 2453 "base": "about:blank", 2454 "href": "https://foo/", 2455 "origin": "https://foo", 2456 "protocol": "https:", 2457 "username": "", 2458 "password": "", 2459 "host": "foo", 2460 "hostname": "foo", 2461 "port": "", 2462 "pathname": "/", 2463 "search": "", 2464 "hash": "" 2465 }, 2466 { 2467 "input": "https://foo:80/", 2468 "base": "about:blank", 2469 "href": "https://foo:80/", 2470 "origin": "https://foo:80", 2471 "protocol": "https:", 2472 "username": "", 2473 "password": "", 2474 "host": "foo:80", 2475 "hostname": "foo", 2476 "port": "80", 2477 "pathname": "/", 2478 "search": "", 2479 "hash": "" 2480 }, 2481 { 2482 "input": "ftp://foo:21/", 2483 "base": "about:blank", 2484 "href": "ftp://foo/", 2485 "origin": "ftp://foo", 2486 "protocol": "ftp:", 2487 "username": "", 2488 "password": "", 2489 "host": "foo", 2490 "hostname": "foo", 2491 "port": "", 2492 "pathname": "/", 2493 "search": "", 2494 "hash": "" 2495 }, 2496 { 2497 "input": "ftp://foo:80/", 2498 "base": "about:blank", 2499 "href": "ftp://foo:80/", 2500 "origin": "ftp://foo:80", 2501 "protocol": "ftp:", 2502 "username": "", 2503 "password": "", 2504 "host": "foo:80", 2505 "hostname": "foo", 2506 "port": "80", 2507 "pathname": "/", 2508 "search": "", 2509 "hash": "" 2510 }, 2511 { 2512 "input": "gopher://foo:70/", 2513 "base": "about:blank", 2514 "href": "gopher://foo/", 2515 "origin": "gopher://foo", 2516 "protocol": "gopher:", 2517 "username": "", 2518 "password": "", 2519 "host": "foo", 2520 "hostname": "foo", 2521 "port": "", 2522 "pathname": "/", 2523 "search": "", 2524 "hash": "" 2525 }, 2526 { 2527 "input": "gopher://foo:443/", 2528 "base": "about:blank", 2529 "href": "gopher://foo:443/", 2530 "origin": "gopher://foo:443", 2531 "protocol": "gopher:", 2532 "username": "", 2533 "password": "", 2534 "host": "foo:443", 2535 "hostname": "foo", 2536 "port": "443", 2537 "pathname": "/", 2538 "search": "", 2539 "hash": "" 2540 }, 2541 { 2542 "input": "ws://foo:80/", 2543 "base": "about:blank", 2544 "href": "ws://foo/", 2545 "origin": "ws://foo", 2546 "protocol": "ws:", 2547 "username": "", 2548 "password": "", 2549 "host": "foo", 2550 "hostname": "foo", 2551 "port": "", 2552 "pathname": "/", 2553 "search": "", 2554 "hash": "" 2555 }, 2556 { 2557 "input": "ws://foo:81/", 2558 "base": "about:blank", 2559 "href": "ws://foo:81/", 2560 "origin": "ws://foo:81", 2561 "protocol": "ws:", 2562 "username": "", 2563 "password": "", 2564 "host": "foo:81", 2565 "hostname": "foo", 2566 "port": "81", 2567 "pathname": "/", 2568 "search": "", 2569 "hash": "" 2570 }, 2571 { 2572 "input": "ws://foo:443/", 2573 "base": "about:blank", 2574 "href": "ws://foo:443/", 2575 "origin": "ws://foo:443", 2576 "protocol": "ws:", 2577 "username": "", 2578 "password": "", 2579 "host": "foo:443", 2580 "hostname": "foo", 2581 "port": "443", 2582 "pathname": "/", 2583 "search": "", 2584 "hash": "" 2585 }, 2586 { 2587 "input": "ws://foo:815/", 2588 "base": "about:blank", 2589 "href": "ws://foo:815/", 2590 "origin": "ws://foo:815", 2591 "protocol": "ws:", 2592 "username": "", 2593 "password": "", 2594 "host": "foo:815", 2595 "hostname": "foo", 2596 "port": "815", 2597 "pathname": "/", 2598 "search": "", 2599 "hash": "" 2600 }, 2601 { 2602 "input": "wss://foo:80/", 2603 "base": "about:blank", 2604 "href": "wss://foo:80/", 2605 "origin": "wss://foo:80", 2606 "protocol": "wss:", 2607 "username": "", 2608 "password": "", 2609 "host": "foo:80", 2610 "hostname": "foo", 2611 "port": "80", 2612 "pathname": "/", 2613 "search": "", 2614 "hash": "" 2615 }, 2616 { 2617 "input": "wss://foo:81/", 2618 "base": "about:blank", 2619 "href": "wss://foo:81/", 2620 "origin": "wss://foo:81", 2621 "protocol": "wss:", 2622 "username": "", 2623 "password": "", 2624 "host": "foo:81", 2625 "hostname": "foo", 2626 "port": "81", 2627 "pathname": "/", 2628 "search": "", 2629 "hash": "" 2630 }, 2631 { 2632 "input": "wss://foo:443/", 2633 "base": "about:blank", 2634 "href": "wss://foo/", 2635 "origin": "wss://foo", 2636 "protocol": "wss:", 2637 "username": "", 2638 "password": "", 2639 "host": "foo", 2640 "hostname": "foo", 2641 "port": "", 2642 "pathname": "/", 2643 "search": "", 2644 "hash": "" 2645 }, 2646 { 2647 "input": "wss://foo:815/", 2648 "base": "about:blank", 2649 "href": "wss://foo:815/", 2650 "origin": "wss://foo:815", 2651 "protocol": "wss:", 2652 "username": "", 2653 "password": "", 2654 "host": "foo:815", 2655 "hostname": "foo", 2656 "port": "815", 2657 "pathname": "/", 2658 "search": "", 2659 "hash": "" 2660 }, 2661 { 2662 "input": "http:/example.com/", 2663 "base": "about:blank", 2664 "href": "http://example.com/", 2665 "origin": "http://example.com", 2666 "protocol": "http:", 2667 "username": "", 2668 "password": "", 2669 "host": "example.com", 2670 "hostname": "example.com", 2671 "port": "", 2672 "pathname": "/", 2673 "search": "", 2674 "hash": "" 2675 }, 2676 { 2677 "input": "ftp:/example.com/", 2678 "base": "about:blank", 2679 "href": "ftp://example.com/", 2680 "origin": "ftp://example.com", 2681 "protocol": "ftp:", 2682 "username": "", 2683 "password": "", 2684 "host": "example.com", 2685 "hostname": "example.com", 2686 "port": "", 2687 "pathname": "/", 2688 "search": "", 2689 "hash": "" 2690 }, 2691 { 2692 "input": "https:/example.com/", 2693 "base": "about:blank", 2694 "href": "https://example.com/", 2695 "origin": "https://example.com", 2696 "protocol": "https:", 2697 "username": "", 2698 "password": "", 2699 "host": "example.com", 2700 "hostname": "example.com", 2701 "port": "", 2702 "pathname": "/", 2703 "search": "", 2704 "hash": "" 2705 }, 2706 { 2707 "input": "madeupscheme:/example.com/", 2708 "base": "about:blank", 2709 "href": "madeupscheme:/example.com/", 2710 "origin": "null", 2711 "protocol": "madeupscheme:", 2712 "username": "", 2713 "password": "", 2714 "host": "", 2715 "hostname": "", 2716 "port": "", 2717 "pathname": "/example.com/", 2718 "search": "", 2719 "hash": "" 2720 }, 2721 { 2722 "input": "file:/example.com/", 2723 "base": "about:blank", 2724 "href": "file:///example.com/", 2725 "protocol": "file:", 2726 "username": "", 2727 "password": "", 2728 "host": "", 2729 "hostname": "", 2730 "port": "", 2731 "pathname": "/example.com/", 2732 "search": "", 2733 "hash": "" 2734 }, 2735 { 2736 "input": "ftps:/example.com/", 2737 "base": "about:blank", 2738 "href": "ftps:/example.com/", 2739 "origin": "null", 2740 "protocol": "ftps:", 2741 "username": "", 2742 "password": "", 2743 "host": "", 2744 "hostname": "", 2745 "port": "", 2746 "pathname": "/example.com/", 2747 "search": "", 2748 "hash": "" 2749 }, 2750 { 2751 "input": "gopher:/example.com/", 2752 "base": "about:blank", 2753 "href": "gopher://example.com/", 2754 "origin": "gopher://example.com", 2755 "protocol": "gopher:", 2756 "username": "", 2757 "password": "", 2758 "host": "example.com", 2759 "hostname": "example.com", 2760 "port": "", 2761 "pathname": "/", 2762 "search": "", 2763 "hash": "" 2764 }, 2765 { 2766 "input": "ws:/example.com/", 2767 "base": "about:blank", 2768 "href": "ws://example.com/", 2769 "origin": "ws://example.com", 2770 "protocol": "ws:", 2771 "username": "", 2772 "password": "", 2773 "host": "example.com", 2774 "hostname": "example.com", 2775 "port": "", 2776 "pathname": "/", 2777 "search": "", 2778 "hash": "" 2779 }, 2780 { 2781 "input": "wss:/example.com/", 2782 "base": "about:blank", 2783 "href": "wss://example.com/", 2784 "origin": "wss://example.com", 2785 "protocol": "wss:", 2786 "username": "", 2787 "password": "", 2788 "host": "example.com", 2789 "hostname": "example.com", 2790 "port": "", 2791 "pathname": "/", 2792 "search": "", 2793 "hash": "" 2794 }, 2795 { 2796 "input": "data:/example.com/", 2797 "base": "about:blank", 2798 "href": "data:/example.com/", 2799 "origin": "null", 2800 "protocol": "data:", 2801 "username": "", 2802 "password": "", 2803 "host": "", 2804 "hostname": "", 2805 "port": "", 2806 "pathname": "/example.com/", 2807 "search": "", 2808 "hash": "" 2809 }, 2810 { 2811 "input": "javascript:/example.com/", 2812 "base": "about:blank", 2813 "href": "javascript:/example.com/", 2814 "origin": "null", 2815 "protocol": "javascript:", 2816 "username": "", 2817 "password": "", 2818 "host": "", 2819 "hostname": "", 2820 "port": "", 2821 "pathname": "/example.com/", 2822 "search": "", 2823 "hash": "" 2824 }, 2825 { 2826 "input": "mailto:/example.com/", 2827 "base": "about:blank", 2828 "href": "mailto:/example.com/", 2829 "origin": "null", 2830 "protocol": "mailto:", 2831 "username": "", 2832 "password": "", 2833 "host": "", 2834 "hostname": "", 2835 "port": "", 2836 "pathname": "/example.com/", 2837 "search": "", 2838 "hash": "" 2839 }, 2840 { 2841 "input": "http:example.com/", 2842 "base": "about:blank", 2843 "href": "http://example.com/", 2844 "origin": "http://example.com", 2845 "protocol": "http:", 2846 "username": "", 2847 "password": "", 2848 "host": "example.com", 2849 "hostname": "example.com", 2850 "port": "", 2851 "pathname": "/", 2852 "search": "", 2853 "hash": "" 2854 }, 2855 { 2856 "input": "ftp:example.com/", 2857 "base": "about:blank", 2858 "href": "ftp://example.com/", 2859 "origin": "ftp://example.com", 2860 "protocol": "ftp:", 2861 "username": "", 2862 "password": "", 2863 "host": "example.com", 2864 "hostname": "example.com", 2865 "port": "", 2866 "pathname": "/", 2867 "search": "", 2868 "hash": "" 2869 }, 2870 { 2871 "input": "https:example.com/", 2872 "base": "about:blank", 2873 "href": "https://example.com/", 2874 "origin": "https://example.com", 2875 "protocol": "https:", 2876 "username": "", 2877 "password": "", 2878 "host": "example.com", 2879 "hostname": "example.com", 2880 "port": "", 2881 "pathname": "/", 2882 "search": "", 2883 "hash": "" 2884 }, 2885 { 2886 "input": "madeupscheme:example.com/", 2887 "base": "about:blank", 2888 "href": "madeupscheme:example.com/", 2889 "origin": "null", 2890 "protocol": "madeupscheme:", 2891 "username": "", 2892 "password": "", 2893 "host": "", 2894 "hostname": "", 2895 "port": "", 2896 "pathname": "example.com/", 2897 "search": "", 2898 "hash": "" 2899 }, 2900 { 2901 "input": "ftps:example.com/", 2902 "base": "about:blank", 2903 "href": "ftps:example.com/", 2904 "origin": "null", 2905 "protocol": "ftps:", 2906 "username": "", 2907 "password": "", 2908 "host": "", 2909 "hostname": "", 2910 "port": "", 2911 "pathname": "example.com/", 2912 "search": "", 2913 "hash": "" 2914 }, 2915 { 2916 "input": "gopher:example.com/", 2917 "base": "about:blank", 2918 "href": "gopher://example.com/", 2919 "origin": "gopher://example.com", 2920 "protocol": "gopher:", 2921 "username": "", 2922 "password": "", 2923 "host": "example.com", 2924 "hostname": "example.com", 2925 "port": "", 2926 "pathname": "/", 2927 "search": "", 2928 "hash": "" 2929 }, 2930 { 2931 "input": "ws:example.com/", 2932 "base": "about:blank", 2933 "href": "ws://example.com/", 2934 "origin": "ws://example.com", 2935 "protocol": "ws:", 2936 "username": "", 2937 "password": "", 2938 "host": "example.com", 2939 "hostname": "example.com", 2940 "port": "", 2941 "pathname": "/", 2942 "search": "", 2943 "hash": "" 2944 }, 2945 { 2946 "input": "wss:example.com/", 2947 "base": "about:blank", 2948 "href": "wss://example.com/", 2949 "origin": "wss://example.com", 2950 "protocol": "wss:", 2951 "username": "", 2952 "password": "", 2953 "host": "example.com", 2954 "hostname": "example.com", 2955 "port": "", 2956 "pathname": "/", 2957 "search": "", 2958 "hash": "" 2959 }, 2960 { 2961 "input": "data:example.com/", 2962 "base": "about:blank", 2963 "href": "data:example.com/", 2964 "origin": "null", 2965 "protocol": "data:", 2966 "username": "", 2967 "password": "", 2968 "host": "", 2969 "hostname": "", 2970 "port": "", 2971 "pathname": "example.com/", 2972 "search": "", 2973 "hash": "" 2974 }, 2975 { 2976 "input": "javascript:example.com/", 2977 "base": "about:blank", 2978 "href": "javascript:example.com/", 2979 "origin": "null", 2980 "protocol": "javascript:", 2981 "username": "", 2982 "password": "", 2983 "host": "", 2984 "hostname": "", 2985 "port": "", 2986 "pathname": "example.com/", 2987 "search": "", 2988 "hash": "" 2989 }, 2990 { 2991 "input": "mailto:example.com/", 2992 "base": "about:blank", 2993 "href": "mailto:example.com/", 2994 "origin": "null", 2995 "protocol": "mailto:", 2996 "username": "", 2997 "password": "", 2998 "host": "", 2999 "hostname": "", 3000 "port": "", 3001 "pathname": "example.com/", 3002 "search": "", 3003 "hash": "" 3004 }, 3005 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html", 3006 { 3007 "input": "http:@www.example.com", 3008 "base": "about:blank", 3009 "href": "http://www.example.com/", 3010 "origin": "http://www.example.com", 3011 "protocol": "http:", 3012 "username": "", 3013 "password": "", 3014 "host": "www.example.com", 3015 "hostname": "www.example.com", 3016 "port": "", 3017 "pathname": "/", 3018 "search": "", 3019 "hash": "" 3020 }, 3021 { 3022 "input": "http:/@www.example.com", 3023 "base": "about:blank", 3024 "href": "http://www.example.com/", 3025 "origin": "http://www.example.com", 3026 "protocol": "http:", 3027 "username": "", 3028 "password": "", 3029 "host": "www.example.com", 3030 "hostname": "www.example.com", 3031 "port": "", 3032 "pathname": "/", 3033 "search": "", 3034 "hash": "" 3035 }, 3036 { 3037 "input": "http://@www.example.com", 3038 "base": "about:blank", 3039 "href": "http://www.example.com/", 3040 "origin": "http://www.example.com", 3041 "protocol": "http:", 3042 "username": "", 3043 "password": "", 3044 "host": "www.example.com", 3045 "hostname": "www.example.com", 3046 "port": "", 3047 "pathname": "/", 3048 "search": "", 3049 "hash": "" 3050 }, 3051 { 3052 "input": "http:a:b@www.example.com", 3053 "base": "about:blank", 3054 "href": "http://a:b@www.example.com/", 3055 "origin": "http://www.example.com", 3056 "protocol": "http:", 3057 "username": "a", 3058 "password": "b", 3059 "host": "www.example.com", 3060 "hostname": "www.example.com", 3061 "port": "", 3062 "pathname": "/", 3063 "search": "", 3064 "hash": "" 3065 }, 3066 { 3067 "input": "http:/a:b@www.example.com", 3068 "base": "about:blank", 3069 "href": "http://a:b@www.example.com/", 3070 "origin": "http://www.example.com", 3071 "protocol": "http:", 3072 "username": "a", 3073 "password": "b", 3074 "host": "www.example.com", 3075 "hostname": "www.example.com", 3076 "port": "", 3077 "pathname": "/", 3078 "search": "", 3079 "hash": "" 3080 }, 3081 { 3082 "input": "http://a:b@www.example.com", 3083 "base": "about:blank", 3084 "href": "http://a:b@www.example.com/", 3085 "origin": "http://www.example.com", 3086 "protocol": "http:", 3087 "username": "a", 3088 "password": "b", 3089 "host": "www.example.com", 3090 "hostname": "www.example.com", 3091 "port": "", 3092 "pathname": "/", 3093 "search": "", 3094 "hash": "" 3095 }, 3096 { 3097 "input": "http://@pple.com", 3098 "base": "about:blank", 3099 "href": "http://pple.com/", 3100 "origin": "http://pple.com", 3101 "protocol": "http:", 3102 "username": "", 3103 "password": "", 3104 "host": "pple.com", 3105 "hostname": "pple.com", 3106 "port": "", 3107 "pathname": "/", 3108 "search": "", 3109 "hash": "" 3110 }, 3111 { 3112 "input": "http::b@www.example.com", 3113 "base": "about:blank", 3114 "href": "http://:b@www.example.com/", 3115 "origin": "http://www.example.com", 3116 "protocol": "http:", 3117 "username": "", 3118 "password": "b", 3119 "host": "www.example.com", 3120 "hostname": "www.example.com", 3121 "port": "", 3122 "pathname": "/", 3123 "search": "", 3124 "hash": "" 3125 }, 3126 { 3127 "input": "http:/:b@www.example.com", 3128 "base": "about:blank", 3129 "href": "http://:b@www.example.com/", 3130 "origin": "http://www.example.com", 3131 "protocol": "http:", 3132 "username": "", 3133 "password": "b", 3134 "host": "www.example.com", 3135 "hostname": "www.example.com", 3136 "port": "", 3137 "pathname": "/", 3138 "search": "", 3139 "hash": "" 3140 }, 3141 { 3142 "input": "http://:b@www.example.com", 3143 "base": "about:blank", 3144 "href": "http://:b@www.example.com/", 3145 "origin": "http://www.example.com", 3146 "protocol": "http:", 3147 "username": "", 3148 "password": "b", 3149 "host": "www.example.com", 3150 "hostname": "www.example.com", 3151 "port": "", 3152 "pathname": "/", 3153 "search": "", 3154 "hash": "" 3155 }, 3156 { 3157 "input": "http:/:@/www.example.com", 3158 "base": "about:blank", 3159 "failure": true 3160 }, 3161 { 3162 "input": "http://user@/www.example.com", 3163 "base": "about:blank", 3164 "failure": true 3165 }, 3166 { 3167 "input": "http:@/www.example.com", 3168 "base": "about:blank", 3169 "failure": true 3170 }, 3171 { 3172 "input": "http:/@/www.example.com", 3173 "base": "about:blank", 3174 "failure": true 3175 }, 3176 { 3177 "input": "http://@/www.example.com", 3178 "base": "about:blank", 3179 "failure": true 3180 }, 3181 { 3182 "input": "https:@/www.example.com", 3183 "base": "about:blank", 3184 "failure": true 3185 }, 3186 { 3187 "input": "http:a:b@/www.example.com", 3188 "base": "about:blank", 3189 "failure": true 3190 }, 3191 { 3192 "input": "http:/a:b@/www.example.com", 3193 "base": "about:blank", 3194 "failure": true 3195 }, 3196 { 3197 "input": "http://a:b@/www.example.com", 3198 "base": "about:blank", 3199 "failure": true 3200 }, 3201 { 3202 "input": "http::@/www.example.com", 3203 "base": "about:blank", 3204 "failure": true 3205 }, 3206 { 3207 "input": "http:a:@www.example.com", 3208 "base": "about:blank", 3209 "href": "http://a@www.example.com/", 3210 "origin": "http://www.example.com", 3211 "protocol": "http:", 3212 "username": "a", 3213 "password": "", 3214 "host": "www.example.com", 3215 "hostname": "www.example.com", 3216 "port": "", 3217 "pathname": "/", 3218 "search": "", 3219 "hash": "" 3220 }, 3221 { 3222 "input": "http:/a:@www.example.com", 3223 "base": "about:blank", 3224 "href": "http://a@www.example.com/", 3225 "origin": "http://www.example.com", 3226 "protocol": "http:", 3227 "username": "a", 3228 "password": "", 3229 "host": "www.example.com", 3230 "hostname": "www.example.com", 3231 "port": "", 3232 "pathname": "/", 3233 "search": "", 3234 "hash": "" 3235 }, 3236 { 3237 "input": "http://a:@www.example.com", 3238 "base": "about:blank", 3239 "href": "http://a@www.example.com/", 3240 "origin": "http://www.example.com", 3241 "protocol": "http:", 3242 "username": "a", 3243 "password": "", 3244 "host": "www.example.com", 3245 "hostname": "www.example.com", 3246 "port": "", 3247 "pathname": "/", 3248 "search": "", 3249 "hash": "" 3250 }, 3251 { 3252 "input": "http://www.@pple.com", 3253 "base": "about:blank", 3254 "href": "http://www.@pple.com/", 3255 "origin": "http://pple.com", 3256 "protocol": "http:", 3257 "username": "www.", 3258 "password": "", 3259 "host": "pple.com", 3260 "hostname": "pple.com", 3261 "port": "", 3262 "pathname": "/", 3263 "search": "", 3264 "hash": "" 3265 }, 3266 { 3267 "input": "http:@:www.example.com", 3268 "base": "about:blank", 3269 "failure": true 3270 }, 3271 { 3272 "input": "http:/@:www.example.com", 3273 "base": "about:blank", 3274 "failure": true 3275 }, 3276 { 3277 "input": "http://@:www.example.com", 3278 "base": "about:blank", 3279 "failure": true 3280 }, 3281 { 3282 "input": "http://:@www.example.com", 3283 "base": "about:blank", 3284 "href": "http://www.example.com/", 3285 "origin": "http://www.example.com", 3286 "protocol": "http:", 3287 "username": "", 3288 "password": "", 3289 "host": "www.example.com", 3290 "hostname": "www.example.com", 3291 "port": "", 3292 "pathname": "/", 3293 "search": "", 3294 "hash": "" 3295 }, 3296 "# Others", 3297 { 3298 "input": "/", 3299 "base": "http://www.example.com/test", 3300 "href": "http://www.example.com/", 3301 "origin": "http://www.example.com", 3302 "protocol": "http:", 3303 "username": "", 3304 "password": "", 3305 "host": "www.example.com", 3306 "hostname": "www.example.com", 3307 "port": "", 3308 "pathname": "/", 3309 "search": "", 3310 "hash": "" 3311 }, 3312 { 3313 "input": "/test.txt", 3314 "base": "http://www.example.com/test", 3315 "href": "http://www.example.com/test.txt", 3316 "origin": "http://www.example.com", 3317 "protocol": "http:", 3318 "username": "", 3319 "password": "", 3320 "host": "www.example.com", 3321 "hostname": "www.example.com", 3322 "port": "", 3323 "pathname": "/test.txt", 3324 "search": "", 3325 "hash": "" 3326 }, 3327 { 3328 "input": ".", 3329 "base": "http://www.example.com/test", 3330 "href": "http://www.example.com/", 3331 "origin": "http://www.example.com", 3332 "protocol": "http:", 3333 "username": "", 3334 "password": "", 3335 "host": "www.example.com", 3336 "hostname": "www.example.com", 3337 "port": "", 3338 "pathname": "/", 3339 "search": "", 3340 "hash": "" 3341 }, 3342 { 3343 "input": "..", 3344 "base": "http://www.example.com/test", 3345 "href": "http://www.example.com/", 3346 "origin": "http://www.example.com", 3347 "protocol": "http:", 3348 "username": "", 3349 "password": "", 3350 "host": "www.example.com", 3351 "hostname": "www.example.com", 3352 "port": "", 3353 "pathname": "/", 3354 "search": "", 3355 "hash": "" 3356 }, 3357 { 3358 "input": "test.txt", 3359 "base": "http://www.example.com/test", 3360 "href": "http://www.example.com/test.txt", 3361 "origin": "http://www.example.com", 3362 "protocol": "http:", 3363 "username": "", 3364 "password": "", 3365 "host": "www.example.com", 3366 "hostname": "www.example.com", 3367 "port": "", 3368 "pathname": "/test.txt", 3369 "search": "", 3370 "hash": "" 3371 }, 3372 { 3373 "input": "./test.txt", 3374 "base": "http://www.example.com/test", 3375 "href": "http://www.example.com/test.txt", 3376 "origin": "http://www.example.com", 3377 "protocol": "http:", 3378 "username": "", 3379 "password": "", 3380 "host": "www.example.com", 3381 "hostname": "www.example.com", 3382 "port": "", 3383 "pathname": "/test.txt", 3384 "search": "", 3385 "hash": "" 3386 }, 3387 { 3388 "input": "../test.txt", 3389 "base": "http://www.example.com/test", 3390 "href": "http://www.example.com/test.txt", 3391 "origin": "http://www.example.com", 3392 "protocol": "http:", 3393 "username": "", 3394 "password": "", 3395 "host": "www.example.com", 3396 "hostname": "www.example.com", 3397 "port": "", 3398 "pathname": "/test.txt", 3399 "search": "", 3400 "hash": "" 3401 }, 3402 { 3403 "input": "../aaa/test.txt", 3404 "base": "http://www.example.com/test", 3405 "href": "http://www.example.com/aaa/test.txt", 3406 "origin": "http://www.example.com", 3407 "protocol": "http:", 3408 "username": "", 3409 "password": "", 3410 "host": "www.example.com", 3411 "hostname": "www.example.com", 3412 "port": "", 3413 "pathname": "/aaa/test.txt", 3414 "search": "", 3415 "hash": "" 3416 }, 3417 { 3418 "input": "../../test.txt", 3419 "base": "http://www.example.com/test", 3420 "href": "http://www.example.com/test.txt", 3421 "origin": "http://www.example.com", 3422 "protocol": "http:", 3423 "username": "", 3424 "password": "", 3425 "host": "www.example.com", 3426 "hostname": "www.example.com", 3427 "port": "", 3428 "pathname": "/test.txt", 3429 "search": "", 3430 "hash": "" 3431 }, 3432 { 3433 "input": "中/test.txt", 3434 "base": "http://www.example.com/test", 3435 "href": "http://www.example.com/%E4%B8%AD/test.txt", 3436 "origin": "http://www.example.com", 3437 "protocol": "http:", 3438 "username": "", 3439 "password": "", 3440 "host": "www.example.com", 3441 "hostname": "www.example.com", 3442 "port": "", 3443 "pathname": "/%E4%B8%AD/test.txt", 3444 "search": "", 3445 "hash": "" 3446 }, 3447 { 3448 "input": "http://www.example2.com", 3449 "base": "http://www.example.com/test", 3450 "href": "http://www.example2.com/", 3451 "origin": "http://www.example2.com", 3452 "protocol": "http:", 3453 "username": "", 3454 "password": "", 3455 "host": "www.example2.com", 3456 "hostname": "www.example2.com", 3457 "port": "", 3458 "pathname": "/", 3459 "search": "", 3460 "hash": "" 3461 }, 3462 { 3463 "input": "//www.example2.com", 3464 "base": "http://www.example.com/test", 3465 "href": "http://www.example2.com/", 3466 "origin": "http://www.example2.com", 3467 "protocol": "http:", 3468 "username": "", 3469 "password": "", 3470 "host": "www.example2.com", 3471 "hostname": "www.example2.com", 3472 "port": "", 3473 "pathname": "/", 3474 "search": "", 3475 "hash": "" 3476 }, 3477 { 3478 "input": "file:...", 3479 "base": "http://www.example.com/test", 3480 "href": "file:///...", 3481 "protocol": "file:", 3482 "username": "", 3483 "password": "", 3484 "host": "", 3485 "hostname": "", 3486 "port": "", 3487 "pathname": "/...", 3488 "search": "", 3489 "hash": "" 3490 }, 3491 { 3492 "input": "file:..", 3493 "base": "http://www.example.com/test", 3494 "href": "file:///", 3495 "protocol": "file:", 3496 "username": "", 3497 "password": "", 3498 "host": "", 3499 "hostname": "", 3500 "port": "", 3501 "pathname": "/", 3502 "search": "", 3503 "hash": "" 3504 }, 3505 { 3506 "input": "file:a", 3507 "base": "http://www.example.com/test", 3508 "href": "file:///a", 3509 "protocol": "file:", 3510 "username": "", 3511 "password": "", 3512 "host": "", 3513 "hostname": "", 3514 "port": "", 3515 "pathname": "/a", 3516 "search": "", 3517 "hash": "" 3518 }, 3519 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html", 3520 "Basic canonicalization, uppercase should be converted to lowercase", 3521 { 3522 "input": "http://ExAmPlE.CoM", 3523 "base": "http://other.com/", 3524 "href": "http://example.com/", 3525 "origin": "http://example.com", 3526 "protocol": "http:", 3527 "username": "", 3528 "password": "", 3529 "host": "example.com", 3530 "hostname": "example.com", 3531 "port": "", 3532 "pathname": "/", 3533 "search": "", 3534 "hash": "" 3535 }, 3536 { 3537 "input": "http://example example.com", 3538 "base": "http://other.com/", 3539 "failure": true 3540 }, 3541 { 3542 "input": "http://Goo%20 goo%7C|.com", 3543 "base": "http://other.com/", 3544 "failure": true 3545 }, 3546 { 3547 "input": "http://[]", 3548 "base": "http://other.com/", 3549 "failure": true 3550 }, 3551 { 3552 "input": "http://[:]", 3553 "base": "http://other.com/", 3554 "failure": true 3555 }, 3556 "U+3000 is mapped to U+0020 (space) which is disallowed", 3557 { 3558 "input": "http://GOO\u00a0\u3000goo.com", 3559 "base": "http://other.com/", 3560 "failure": true 3561 }, 3562 "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", 3563 { 3564 "input": "http://GOO\u200b\u2060\ufeffgoo.com", 3565 "base": "http://other.com/", 3566 "href": "http://googoo.com/", 3567 "origin": "http://googoo.com", 3568 "protocol": "http:", 3569 "username": "", 3570 "password": "", 3571 "host": "googoo.com", 3572 "hostname": "googoo.com", 3573 "port": "", 3574 "pathname": "/", 3575 "search": "", 3576 "hash": "" 3577 }, 3578 "Leading and trailing C0 control or space", 3579 { 3580 "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ", 3581 "base": "about:blank", 3582 "href": "http://example.com/", 3583 "origin": "http://example.com", 3584 "protocol": "http:", 3585 "username": "", 3586 "password": "", 3587 "host": "example.com", 3588 "hostname": "example.com", 3589 "port": "", 3590 "pathname": "/", 3591 "search": "", 3592 "hash": "" 3593 }, 3594 "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)", 3595 { 3596 "input": "http://www.foo。bar.com", 3597 "base": "http://other.com/", 3598 "href": "http://www.foo.bar.com/", 3599 "origin": "http://www.foo.bar.com", 3600 "protocol": "http:", 3601 "username": "", 3602 "password": "", 3603 "host": "www.foo.bar.com", 3604 "hostname": "www.foo.bar.com", 3605 "port": "", 3606 "pathname": "/", 3607 "search": "", 3608 "hash": "" 3609 }, 3610 "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0", 3611 { 3612 "input": "http://\ufdd0zyx.com", 3613 "base": "http://other.com/", 3614 "failure": true 3615 }, 3616 "This is the same as previous but escaped", 3617 { 3618 "input": "http://%ef%b7%90zyx.com", 3619 "base": "http://other.com/", 3620 "failure": true 3621 }, 3622 "U+FFFD", 3623 { 3624 "input": "https://\ufffd", 3625 "base": "about:blank", 3626 "failure": true 3627 }, 3628 { 3629 "input": "https://%EF%BF%BD", 3630 "base": "about:blank", 3631 "failure": true 3632 }, 3633 { 3634 "input": "https://x/\ufffd?\ufffd#\ufffd", 3635 "base": "about:blank", 3636 "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD", 3637 "origin": "https://x", 3638 "protocol": "https:", 3639 "username": "", 3640 "password": "", 3641 "host": "x", 3642 "hostname": "x", 3643 "port": "", 3644 "pathname": "/%EF%BF%BD", 3645 "search": "?%EF%BF%BD", 3646 "hash": "#%EF%BF%BD" 3647 }, 3648 "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.", 3649 { 3650 "input": "http://Go.com", 3651 "base": "http://other.com/", 3652 "href": "http://go.com/", 3653 "origin": "http://go.com", 3654 "protocol": "http:", 3655 "username": "", 3656 "password": "", 3657 "host": "go.com", 3658 "hostname": "go.com", 3659 "port": "", 3660 "pathname": "/", 3661 "search": "", 3662 "hash": "" 3663 }, 3664 "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257", 3665 { 3666 "input": "http://%41.com", 3667 "base": "http://other.com/", 3668 "failure": true 3669 }, 3670 { 3671 "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com", 3672 "base": "http://other.com/", 3673 "failure": true 3674 }, 3675 "...%00 in fullwidth should fail (also as escaped UTF-8 input)", 3676 { 3677 "input": "http://%00.com", 3678 "base": "http://other.com/", 3679 "failure": true 3680 }, 3681 { 3682 "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com", 3683 "base": "http://other.com/", 3684 "failure": true 3685 }, 3686 "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN", 3687 { 3688 "input": "http://你好你好", 3689 "base": "http://other.com/", 3690 "href": "http://xn--6qqa088eba/", 3691 "origin": "http://xn--6qqa088eba", 3692 "protocol": "http:", 3693 "username": "", 3694 "password": "", 3695 "host": "xn--6qqa088eba", 3696 "hostname": "xn--6qqa088eba", 3697 "port": "", 3698 "pathname": "/", 3699 "search": "", 3700 "hash": "" 3701 }, 3702 { 3703 "input": "https://faß.ExAmPlE/", 3704 "base": "about:blank", 3705 "href": "https://xn--fa-hia.example/", 3706 "origin": "https://xn--fa-hia.example", 3707 "protocol": "https:", 3708 "username": "", 3709 "password": "", 3710 "host": "xn--fa-hia.example", 3711 "hostname": "xn--fa-hia.example", 3712 "port": "", 3713 "pathname": "/", 3714 "search": "", 3715 "hash": "" 3716 }, 3717 { 3718 "input": "sc://faß.ExAmPlE/", 3719 "base": "about:blank", 3720 "href": "sc://fa%C3%9F.ExAmPlE/", 3721 "origin": "null", 3722 "protocol": "sc:", 3723 "username": "", 3724 "password": "", 3725 "host": "fa%C3%9F.ExAmPlE", 3726 "hostname": "fa%C3%9F.ExAmPlE", 3727 "port": "", 3728 "pathname": "/", 3729 "search": "", 3730 "hash": "" 3731 }, 3732 "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191", 3733 { 3734 "input": "http://%zz%66%a.com", 3735 "base": "http://other.com/", 3736 "failure": true 3737 }, 3738 "If we get an invalid character that has been escaped.", 3739 { 3740 "input": "http://%25", 3741 "base": "http://other.com/", 3742 "failure": true 3743 }, 3744 { 3745 "input": "http://hello%00", 3746 "base": "http://other.com/", 3747 "failure": true 3748 }, 3749 "Escaped numbers should be treated like IP addresses if they are.", 3750 { 3751 "input": "http://%30%78%63%30%2e%30%32%35%30.01", 3752 "base": "http://other.com/", 3753 "href": "http://192.168.0.1/", 3754 "origin": "http://192.168.0.1", 3755 "protocol": "http:", 3756 "username": "", 3757 "password": "", 3758 "host": "192.168.0.1", 3759 "hostname": "192.168.0.1", 3760 "port": "", 3761 "pathname": "/", 3762 "search": "", 3763 "hash": "" 3764 }, 3765 { 3766 "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e", 3767 "base": "http://other.com/", 3768 "href": "http://192.168.0.1/", 3769 "origin": "http://192.168.0.1", 3770 "protocol": "http:", 3771 "username": "", 3772 "password": "", 3773 "host": "192.168.0.1", 3774 "hostname": "192.168.0.1", 3775 "port": "", 3776 "pathname": "/", 3777 "search": "", 3778 "hash": "" 3779 }, 3780 { 3781 "input": "http://192.168.0.257", 3782 "base": "http://other.com/", 3783 "failure": true 3784 }, 3785 "Invalid escaping in hosts causes failure", 3786 { 3787 "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01", 3788 "base": "http://other.com/", 3789 "failure": true 3790 }, 3791 "A space in a host causes failure", 3792 { 3793 "input": "http://192.168.0.1 hello", 3794 "base": "http://other.com/", 3795 "failure": true 3796 }, 3797 { 3798 "input": "https://x x:12", 3799 "base": "about:blank", 3800 "failure": true 3801 }, 3802 "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP", 3803 { 3804 "input": "http://0Xc0.0250.01", 3805 "base": "http://other.com/", 3806 "href": "http://192.168.0.1/", 3807 "origin": "http://192.168.0.1", 3808 "protocol": "http:", 3809 "username": "", 3810 "password": "", 3811 "host": "192.168.0.1", 3812 "hostname": "192.168.0.1", 3813 "port": "", 3814 "pathname": "/", 3815 "search": "", 3816 "hash": "" 3817 }, 3818 "Domains with empty labels", 3819 { 3820 "input": "http://./", 3821 "base": "about:blank", 3822 "href": "http://./", 3823 "origin": "http://.", 3824 "protocol": "http:", 3825 "username": "", 3826 "password": "", 3827 "host": ".", 3828 "hostname": ".", 3829 "port": "", 3830 "pathname": "/", 3831 "search": "", 3832 "hash": "" 3833 }, 3834 { 3835 "input": "http://../", 3836 "base": "about:blank", 3837 "href": "http://../", 3838 "origin": "http://..", 3839 "protocol": "http:", 3840 "username": "", 3841 "password": "", 3842 "host": "..", 3843 "hostname": "..", 3844 "port": "", 3845 "pathname": "/", 3846 "search": "", 3847 "hash": "" 3848 }, 3849 { 3850 "input": "http://0..0x300/", 3851 "base": "about:blank", 3852 "href": "http://0..0x300/", 3853 "origin": "http://0..0x300", 3854 "protocol": "http:", 3855 "username": "", 3856 "password": "", 3857 "host": "0..0x300", 3858 "hostname": "0..0x300", 3859 "port": "", 3860 "pathname": "/", 3861 "search": "", 3862 "hash": "" 3863 }, 3864 "Broken IPv6", 3865 { 3866 "input": "http://[www.google.com]/", 3867 "base": "about:blank", 3868 "failure": true 3869 }, 3870 { 3871 "input": "http://[google.com]", 3872 "base": "http://other.com/", 3873 "failure": true 3874 }, 3875 { 3876 "input": "http://[::1.2.3.4x]", 3877 "base": "http://other.com/", 3878 "failure": true 3879 }, 3880 { 3881 "input": "http://[::1.2.3.]", 3882 "base": "http://other.com/", 3883 "failure": true 3884 }, 3885 { 3886 "input": "http://[::1.2.]", 3887 "base": "http://other.com/", 3888 "failure": true 3889 }, 3890 { 3891 "input": "http://[::1.]", 3892 "base": "http://other.com/", 3893 "failure": true 3894 }, 3895 "Misc Unicode", 3896 { 3897 "input": "http://foo:@example.com/bar", 3898 "base": "http://other.com/", 3899 "href": "http://foo:%F0%9F%92%A9@example.com/bar", 3900 "origin": "http://example.com", 3901 "protocol": "http:", 3902 "username": "foo", 3903 "password": "%F0%9F%92%A9", 3904 "host": "example.com", 3905 "hostname": "example.com", 3906 "port": "", 3907 "pathname": "/bar", 3908 "search": "", 3909 "hash": "" 3910 }, 3911 "# resolving a fragment against any scheme succeeds", 3912 { 3913 "input": "#", 3914 "base": "test:test", 3915 "href": "test:test#", 3916 "origin": "null", 3917 "protocol": "test:", 3918 "username": "", 3919 "password": "", 3920 "host": "", 3921 "hostname": "", 3922 "port": "", 3923 "pathname": "test", 3924 "search": "", 3925 "hash": "" 3926 }, 3927 { 3928 "input": "#x", 3929 "base": "mailto:x@x.com", 3930 "href": "mailto:x@x.com#x", 3931 "origin": "null", 3932 "protocol": "mailto:", 3933 "username": "", 3934 "password": "", 3935 "host": "", 3936 "hostname": "", 3937 "port": "", 3938 "pathname": "x@x.com", 3939 "search": "", 3940 "hash": "#x" 3941 }, 3942 { 3943 "input": "#x", 3944 "base": "data:,", 3945 "href": "data:,#x", 3946 "origin": "null", 3947 "protocol": "data:", 3948 "username": "", 3949 "password": "", 3950 "host": "", 3951 "hostname": "", 3952 "port": "", 3953 "pathname": ",", 3954 "search": "", 3955 "hash": "#x" 3956 }, 3957 { 3958 "input": "#x", 3959 "base": "about:blank", 3960 "href": "about:blank#x", 3961 "origin": "null", 3962 "protocol": "about:", 3963 "username": "", 3964 "password": "", 3965 "host": "", 3966 "hostname": "", 3967 "port": "", 3968 "pathname": "blank", 3969 "search": "", 3970 "hash": "#x" 3971 }, 3972 { 3973 "input": "#", 3974 "base": "test:test?test", 3975 "href": "test:test?test#", 3976 "origin": "null", 3977 "protocol": "test:", 3978 "username": "", 3979 "password": "", 3980 "host": "", 3981 "hostname": "", 3982 "port": "", 3983 "pathname": "test", 3984 "search": "?test", 3985 "hash": "" 3986 }, 3987 "# multiple @ in authority state", 3988 { 3989 "input": "https://@test@test@example:800/", 3990 "base": "http://doesnotmatter/", 3991 "href": "https://%40test%40test@example:800/", 3992 "origin": "https://example:800", 3993 "protocol": "https:", 3994 "username": "%40test%40test", 3995 "password": "", 3996 "host": "example:800", 3997 "hostname": "example", 3998 "port": "800", 3999 "pathname": "/", 4000 "search": "", 4001 "hash": "" 4002 }, 4003 { 4004 "input": "https://@@@example", 4005 "base": "http://doesnotmatter/", 4006 "href": "https://%40%40@example/", 4007 "origin": "https://example", 4008 "protocol": "https:", 4009 "username": "%40%40", 4010 "password": "", 4011 "host": "example", 4012 "hostname": "example", 4013 "port": "", 4014 "pathname": "/", 4015 "search": "", 4016 "hash": "" 4017 }, 4018 "non-az-09 characters", 4019 { 4020 "input": "http://`{}:`{}@h/`{}?`{}", 4021 "base": "http://doesnotmatter/", 4022 "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}", 4023 "origin": "http://h", 4024 "protocol": "http:", 4025 "username": "%60%7B%7D", 4026 "password": "%60%7B%7D", 4027 "host": "h", 4028 "hostname": "h", 4029 "port": "", 4030 "pathname": "/%60%7B%7D", 4031 "search": "?`{}", 4032 "hash": "" 4033 }, 4034 "byte is ' and url is special", 4035 { 4036 "input": "http://host/?'", 4037 "base": "about:blank", 4038 "href": "http://host/?%27", 4039 "origin": "http://host", 4040 "protocol": "http:", 4041 "username": "", 4042 "password": "", 4043 "host": "host", 4044 "hostname": "host", 4045 "port": "", 4046 "pathname": "/", 4047 "search": "?%27", 4048 "hash": "" 4049 }, 4050 { 4051 "input": "notspecial://host/?'", 4052 "base": "about:blank", 4053 "href": "notspecial://host/?'", 4054 "origin": "null", 4055 "protocol": "notspecial:", 4056 "username": "", 4057 "password": "", 4058 "host": "host", 4059 "hostname": "host", 4060 "port": "", 4061 "pathname": "/", 4062 "search": "?'", 4063 "hash": "" 4064 }, 4065 "# Credentials in base", 4066 { 4067 "input": "/some/path", 4068 "base": "http://user@example.org/smth", 4069 "href": "http://user@example.org/some/path", 4070 "origin": "http://example.org", 4071 "protocol": "http:", 4072 "username": "user", 4073 "password": "", 4074 "host": "example.org", 4075 "hostname": "example.org", 4076 "port": "", 4077 "pathname": "/some/path", 4078 "search": "", 4079 "hash": "" 4080 }, 4081 { 4082 "input": "", 4083 "base": "http://user:pass@example.org:21/smth", 4084 "href": "http://user:pass@example.org:21/smth", 4085 "origin": "http://example.org:21", 4086 "protocol": "http:", 4087 "username": "user", 4088 "password": "pass", 4089 "host": "example.org:21", 4090 "hostname": "example.org", 4091 "port": "21", 4092 "pathname": "/smth", 4093 "search": "", 4094 "hash": "" 4095 }, 4096 { 4097 "input": "/some/path", 4098 "base": "http://user:pass@example.org:21/smth", 4099 "href": "http://user:pass@example.org:21/some/path", 4100 "origin": "http://example.org:21", 4101 "protocol": "http:", 4102 "username": "user", 4103 "password": "pass", 4104 "host": "example.org:21", 4105 "hostname": "example.org", 4106 "port": "21", 4107 "pathname": "/some/path", 4108 "search": "", 4109 "hash": "" 4110 }, 4111 "# a set of tests designed by zcorpan for relative URLs with unknown schemes", 4112 { 4113 "input": "i", 4114 "base": "sc:sd", 4115 "failure": true 4116 }, 4117 { 4118 "input": "i", 4119 "base": "sc:sd/sd", 4120 "failure": true 4121 }, 4122 { 4123 "input": "i", 4124 "base": "sc:/pa/pa", 4125 "href": "sc:/pa/i", 4126 "origin": "null", 4127 "protocol": "sc:", 4128 "username": "", 4129 "password": "", 4130 "host": "", 4131 "hostname": "", 4132 "port": "", 4133 "pathname": "/pa/i", 4134 "search": "", 4135 "hash": "" 4136 }, 4137 { 4138 "input": "i", 4139 "base": "sc://ho/pa", 4140 "href": "sc://ho/i", 4141 "origin": "null", 4142 "protocol": "sc:", 4143 "username": "", 4144 "password": "", 4145 "host": "ho", 4146 "hostname": "ho", 4147 "port": "", 4148 "pathname": "/i", 4149 "search": "", 4150 "hash": "" 4151 }, 4152 { 4153 "input": "i", 4154 "base": "sc:///pa/pa", 4155 "href": "sc:///pa/i", 4156 "origin": "null", 4157 "protocol": "sc:", 4158 "username": "", 4159 "password": "", 4160 "host": "", 4161 "hostname": "", 4162 "port": "", 4163 "pathname": "/pa/i", 4164 "search": "", 4165 "hash": "" 4166 }, 4167 { 4168 "input": "../i", 4169 "base": "sc:sd", 4170 "failure": true 4171 }, 4172 { 4173 "input": "../i", 4174 "base": "sc:sd/sd", 4175 "failure": true 4176 }, 4177 { 4178 "input": "../i", 4179 "base": "sc:/pa/pa", 4180 "href": "sc:/i", 4181 "origin": "null", 4182 "protocol": "sc:", 4183 "username": "", 4184 "password": "", 4185 "host": "", 4186 "hostname": "", 4187 "port": "", 4188 "pathname": "/i", 4189 "search": "", 4190 "hash": "" 4191 }, 4192 { 4193 "input": "../i", 4194 "base": "sc://ho/pa", 4195 "href": "sc://ho/i", 4196 "origin": "null", 4197 "protocol": "sc:", 4198 "username": "", 4199 "password": "", 4200 "host": "ho", 4201 "hostname": "ho", 4202 "port": "", 4203 "pathname": "/i", 4204 "search": "", 4205 "hash": "" 4206 }, 4207 { 4208 "input": "../i", 4209 "base": "sc:///pa/pa", 4210 "href": "sc:///i", 4211 "origin": "null", 4212 "protocol": "sc:", 4213 "username": "", 4214 "password": "", 4215 "host": "", 4216 "hostname": "", 4217 "port": "", 4218 "pathname": "/i", 4219 "search": "", 4220 "hash": "" 4221 }, 4222 { 4223 "input": "/i", 4224 "base": "sc:sd", 4225 "failure": true 4226 }, 4227 { 4228 "input": "/i", 4229 "base": "sc:sd/sd", 4230 "failure": true 4231 }, 4232 { 4233 "input": "/i", 4234 "base": "sc:/pa/pa", 4235 "href": "sc:/i", 4236 "origin": "null", 4237 "protocol": "sc:", 4238 "username": "", 4239 "password": "", 4240 "host": "", 4241 "hostname": "", 4242 "port": "", 4243 "pathname": "/i", 4244 "search": "", 4245 "hash": "" 4246 }, 4247 { 4248 "input": "/i", 4249 "base": "sc://ho/pa", 4250 "href": "sc://ho/i", 4251 "origin": "null", 4252 "protocol": "sc:", 4253 "username": "", 4254 "password": "", 4255 "host": "ho", 4256 "hostname": "ho", 4257 "port": "", 4258 "pathname": "/i", 4259 "search": "", 4260 "hash": "" 4261 }, 4262 { 4263 "input": "/i", 4264 "base": "sc:///pa/pa", 4265 "href": "sc:///i", 4266 "origin": "null", 4267 "protocol": "sc:", 4268 "username": "", 4269 "password": "", 4270 "host": "", 4271 "hostname": "", 4272 "port": "", 4273 "pathname": "/i", 4274 "search": "", 4275 "hash": "" 4276 }, 4277 { 4278 "input": "?i", 4279 "base": "sc:sd", 4280 "failure": true 4281 }, 4282 { 4283 "input": "?i", 4284 "base": "sc:sd/sd", 4285 "failure": true 4286 }, 4287 { 4288 "input": "?i", 4289 "base": "sc:/pa/pa", 4290 "href": "sc:/pa/pa?i", 4291 "origin": "null", 4292 "protocol": "sc:", 4293 "username": "", 4294 "password": "", 4295 "host": "", 4296 "hostname": "", 4297 "port": "", 4298 "pathname": "/pa/pa", 4299 "search": "?i", 4300 "hash": "" 4301 }, 4302 { 4303 "input": "?i", 4304 "base": "sc://ho/pa", 4305 "href": "sc://ho/pa?i", 4306 "origin": "null", 4307 "protocol": "sc:", 4308 "username": "", 4309 "password": "", 4310 "host": "ho", 4311 "hostname": "ho", 4312 "port": "", 4313 "pathname": "/pa", 4314 "search": "?i", 4315 "hash": "" 4316 }, 4317 { 4318 "input": "?i", 4319 "base": "sc:///pa/pa", 4320 "href": "sc:///pa/pa?i", 4321 "origin": "null", 4322 "protocol": "sc:", 4323 "username": "", 4324 "password": "", 4325 "host": "", 4326 "hostname": "", 4327 "port": "", 4328 "pathname": "/pa/pa", 4329 "search": "?i", 4330 "hash": "" 4331 }, 4332 { 4333 "input": "#i", 4334 "base": "sc:sd", 4335 "href": "sc:sd#i", 4336 "origin": "null", 4337 "protocol": "sc:", 4338 "username": "", 4339 "password": "", 4340 "host": "", 4341 "hostname": "", 4342 "port": "", 4343 "pathname": "sd", 4344 "search": "", 4345 "hash": "#i" 4346 }, 4347 { 4348 "input": "#i", 4349 "base": "sc:sd/sd", 4350 "href": "sc:sd/sd#i", 4351 "origin": "null", 4352 "protocol": "sc:", 4353 "username": "", 4354 "password": "", 4355 "host": "", 4356 "hostname": "", 4357 "port": "", 4358 "pathname": "sd/sd", 4359 "search": "", 4360 "hash": "#i" 4361 }, 4362 { 4363 "input": "#i", 4364 "base": "sc:/pa/pa", 4365 "href": "sc:/pa/pa#i", 4366 "origin": "null", 4367 "protocol": "sc:", 4368 "username": "", 4369 "password": "", 4370 "host": "", 4371 "hostname": "", 4372 "port": "", 4373 "pathname": "/pa/pa", 4374 "search": "", 4375 "hash": "#i" 4376 }, 4377 { 4378 "input": "#i", 4379 "base": "sc://ho/pa", 4380 "href": "sc://ho/pa#i", 4381 "origin": "null", 4382 "protocol": "sc:", 4383 "username": "", 4384 "password": "", 4385 "host": "ho", 4386 "hostname": "ho", 4387 "port": "", 4388 "pathname": "/pa", 4389 "search": "", 4390 "hash": "#i" 4391 }, 4392 { 4393 "input": "#i", 4394 "base": "sc:///pa/pa", 4395 "href": "sc:///pa/pa#i", 4396 "origin": "null", 4397 "protocol": "sc:", 4398 "username": "", 4399 "password": "", 4400 "host": "", 4401 "hostname": "", 4402 "port": "", 4403 "pathname": "/pa/pa", 4404 "search": "", 4405 "hash": "#i" 4406 }, 4407 "# make sure that relative URL logic works on known typically non-relative schemes too", 4408 { 4409 "input": "about:/../", 4410 "base": "about:blank", 4411 "href": "about:/", 4412 "origin": "null", 4413 "protocol": "about:", 4414 "username": "", 4415 "password": "", 4416 "host": "", 4417 "hostname": "", 4418 "port": "", 4419 "pathname": "/", 4420 "search": "", 4421 "hash": "" 4422 }, 4423 { 4424 "input": "data:/../", 4425 "base": "about:blank", 4426 "href": "data:/", 4427 "origin": "null", 4428 "protocol": "data:", 4429 "username": "", 4430 "password": "", 4431 "host": "", 4432 "hostname": "", 4433 "port": "", 4434 "pathname": "/", 4435 "search": "", 4436 "hash": "" 4437 }, 4438 { 4439 "input": "javascript:/../", 4440 "base": "about:blank", 4441 "href": "javascript:/", 4442 "origin": "null", 4443 "protocol": "javascript:", 4444 "username": "", 4445 "password": "", 4446 "host": "", 4447 "hostname": "", 4448 "port": "", 4449 "pathname": "/", 4450 "search": "", 4451 "hash": "" 4452 }, 4453 { 4454 "input": "mailto:/../", 4455 "base": "about:blank", 4456 "href": "mailto:/", 4457 "origin": "null", 4458 "protocol": "mailto:", 4459 "username": "", 4460 "password": "", 4461 "host": "", 4462 "hostname": "", 4463 "port": "", 4464 "pathname": "/", 4465 "search": "", 4466 "hash": "" 4467 }, 4468 "# unknown schemes and their hosts", 4469 { 4470 "input": "sc://ñ.test/", 4471 "base": "about:blank", 4472 "href": "sc://%C3%B1.test/", 4473 "origin": "null", 4474 "protocol": "sc:", 4475 "username": "", 4476 "password": "", 4477 "host": "%C3%B1.test", 4478 "hostname": "%C3%B1.test", 4479 "port": "", 4480 "pathname": "/", 4481 "search": "", 4482 "hash": "" 4483 }, 4484 { 4485 "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/", 4486 "base": "about:blank", 4487 "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/", 4488 "origin": "null", 4489 "protocol": "sc:", 4490 "username": "", 4491 "password": "", 4492 "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~", 4493 "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~", 4494 "port": "", 4495 "pathname": "/", 4496 "search": "", 4497 "hash": "" 4498 }, 4499 { 4500 "input": "sc://\u0000/", 4501 "base": "about:blank", 4502 "failure": true 4503 }, 4504 { 4505 "input": "sc:// /", 4506 "base": "about:blank", 4507 "failure": true 4508 }, 4509 { 4510 "input": "sc://%/", 4511 "base": "about:blank", 4512 "href": "sc://%/", 4513 "protocol": "sc:", 4514 "username": "", 4515 "password": "", 4516 "host": "%", 4517 "hostname": "%", 4518 "port": "", 4519 "pathname": "/", 4520 "search": "", 4521 "hash": "" 4522 }, 4523 { 4524 "input": "sc://@/", 4525 "base": "about:blank", 4526 "failure": true 4527 }, 4528 { 4529 "input": "sc://te@s:t@/", 4530 "base": "about:blank", 4531 "failure": true 4532 }, 4533 { 4534 "input": "sc://:/", 4535 "base": "about:blank", 4536 "failure": true 4537 }, 4538 { 4539 "input": "sc://:12/", 4540 "base": "about:blank", 4541 "failure": true 4542 }, 4543 { 4544 "input": "sc://[/", 4545 "base": "about:blank", 4546 "failure": true 4547 }, 4548 { 4549 "input": "sc://\\/", 4550 "base": "about:blank", 4551 "failure": true 4552 }, 4553 { 4554 "input": "sc://]/", 4555 "base": "about:blank", 4556 "failure": true 4557 }, 4558 { 4559 "input": "x", 4560 "base": "sc://ñ", 4561 "href": "sc://%C3%B1/x", 4562 "origin": "null", 4563 "protocol": "sc:", 4564 "username": "", 4565 "password": "", 4566 "host": "%C3%B1", 4567 "hostname": "%C3%B1", 4568 "port": "", 4569 "pathname": "/x", 4570 "search": "", 4571 "hash": "" 4572 }, 4573 "# unknown schemes and backslashes", 4574 { 4575 "input": "sc:\\../", 4576 "base": "about:blank", 4577 "href": "sc:\\../", 4578 "origin": "null", 4579 "protocol": "sc:", 4580 "username": "", 4581 "password": "", 4582 "host": "", 4583 "hostname": "", 4584 "port": "", 4585 "pathname": "\\../", 4586 "search": "", 4587 "hash": "" 4588 }, 4589 "# unknown scheme with path looking like a password", 4590 { 4591 "input": "sc::a@example.net", 4592 "base": "about:blank", 4593 "href": "sc::a@example.net", 4594 "origin": "null", 4595 "protocol": "sc:", 4596 "username": "", 4597 "password": "", 4598 "host": "", 4599 "hostname": "", 4600 "port": "", 4601 "pathname": ":a@example.net", 4602 "search": "", 4603 "hash": "" 4604 }, 4605 "# unknown scheme with bogus percent-encoding", 4606 { 4607 "input": "wow:%NBD", 4608 "base": "about:blank", 4609 "href": "wow:%NBD", 4610 "origin": "null", 4611 "protocol": "wow:", 4612 "username": "", 4613 "password": "", 4614 "host": "", 4615 "hostname": "", 4616 "port": "", 4617 "pathname": "%NBD", 4618 "search": "", 4619 "hash": "" 4620 }, 4621 { 4622 "input": "wow:%1G", 4623 "base": "about:blank", 4624 "href": "wow:%1G", 4625 "origin": "null", 4626 "protocol": "wow:", 4627 "username": "", 4628 "password": "", 4629 "host": "", 4630 "hostname": "", 4631 "port": "", 4632 "pathname": "%1G", 4633 "search": "", 4634 "hash": "" 4635 }, 4636 "# unknown scheme with non-URL characters in the path", 4637 { 4638 "input": "wow:\uFFFF", 4639 "base": "about:blank", 4640 "href": "wow:%EF%BF%BF", 4641 "origin": "null", 4642 "protocol": "wow:", 4643 "username": "", 4644 "password": "", 4645 "host": "", 4646 "hostname": "", 4647 "port": "", 4648 "pathname": "%EF%BF%BF", 4649 "search": "", 4650 "hash": "" 4651 }, 4652 "# Hosts and percent-encoding", 4653 { 4654 "input": "ftp://example.com%80/", 4655 "base": "about:blank", 4656 "failure": true 4657 }, 4658 { 4659 "input": "ftp://example.com%A0/", 4660 "base": "about:blank", 4661 "failure": true 4662 }, 4663 { 4664 "input": "https://example.com%80/", 4665 "base": "about:blank", 4666 "failure": true 4667 }, 4668 { 4669 "input": "https://example.com%A0/", 4670 "base": "about:blank", 4671 "failure": true 4672 }, 4673 { 4674 "input": "ftp://%e2%98%83", 4675 "base": "about:blank", 4676 "href": "ftp://xn--n3h/", 4677 "origin": "ftp://xn--n3h", 4678 "protocol": "ftp:", 4679 "username": "", 4680 "password": "", 4681 "host": "xn--n3h", 4682 "hostname": "xn--n3h", 4683 "port": "", 4684 "pathname": "/", 4685 "search": "", 4686 "hash": "" 4687 }, 4688 { 4689 "input": "https://%e2%98%83", 4690 "base": "about:blank", 4691 "href": "https://xn--n3h/", 4692 "origin": "https://xn--n3h", 4693 "protocol": "https:", 4694 "username": "", 4695 "password": "", 4696 "host": "xn--n3h", 4697 "hostname": "xn--n3h", 4698 "port": "", 4699 "pathname": "/", 4700 "search": "", 4701 "hash": "" 4702 }, 4703 "# tests from jsdom/whatwg-url designed for code coverage", 4704 { 4705 "input": "http://127.0.0.1:10100/relative_import.html", 4706 "base": "about:blank", 4707 "href": "http://127.0.0.1:10100/relative_import.html", 4708 "origin": "http://127.0.0.1:10100", 4709 "protocol": "http:", 4710 "username": "", 4711 "password": "", 4712 "host": "127.0.0.1:10100", 4713 "hostname": "127.0.0.1", 4714 "port": "10100", 4715 "pathname": "/relative_import.html", 4716 "search": "", 4717 "hash": "" 4718 }, 4719 { 4720 "input": "http://facebook.com/?foo=%7B%22abc%22", 4721 "base": "about:blank", 4722 "href": "http://facebook.com/?foo=%7B%22abc%22", 4723 "origin": "http://facebook.com", 4724 "protocol": "http:", 4725 "username": "", 4726 "password": "", 4727 "host": "facebook.com", 4728 "hostname": "facebook.com", 4729 "port": "", 4730 "pathname": "/", 4731 "search": "?foo=%7B%22abc%22", 4732 "hash": "" 4733 }, 4734 { 4735 "input": "https://localhost:3000/jqueryui@1.2.3", 4736 "base": "about:blank", 4737 "href": "https://localhost:3000/jqueryui@1.2.3", 4738 "origin": "https://localhost:3000", 4739 "protocol": "https:", 4740 "username": "", 4741 "password": "", 4742 "host": "localhost:3000", 4743 "hostname": "localhost", 4744 "port": "3000", 4745 "pathname": "/jqueryui@1.2.3", 4746 "search": "", 4747 "hash": "" 4748 }, 4749 "# tab/LF/CR", 4750 { 4751 "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", 4752 "base": "about:blank", 4753 "href": "http://host:9000/path?query#frag", 4754 "origin": "http://host:9000", 4755 "protocol": "http:", 4756 "username": "", 4757 "password": "", 4758 "host": "host:9000", 4759 "hostname": "host", 4760 "port": "9000", 4761 "pathname": "/path", 4762 "search": "?query", 4763 "hash": "#frag" 4764 }, 4765 "# Stringification of URL.searchParams", 4766 { 4767 "input": "?a=b&c=d", 4768 "base": "http://example.org/foo/bar", 4769 "href": "http://example.org/foo/bar?a=b&c=d", 4770 "origin": "http://example.org", 4771 "protocol": "http:", 4772 "username": "", 4773 "password": "", 4774 "host": "example.org", 4775 "hostname": "example.org", 4776 "port": "", 4777 "pathname": "/foo/bar", 4778 "search": "?a=b&c=d", 4779 "searchParams": "a=b&c=d", 4780 "hash": "" 4781 }, 4782 { 4783 "input": "??a=b&c=d", 4784 "base": "http://example.org/foo/bar", 4785 "href": "http://example.org/foo/bar??a=b&c=d", 4786 "origin": "http://example.org", 4787 "protocol": "http:", 4788 "username": "", 4789 "password": "", 4790 "host": "example.org", 4791 "hostname": "example.org", 4792 "port": "", 4793 "pathname": "/foo/bar", 4794 "search": "??a=b&c=d", 4795 "searchParams": "%3Fa=b&c=d", 4796 "hash": "" 4797 }, 4798 "# Scheme only", 4799 { 4800 "input": "http:", 4801 "base": "http://example.org/foo/bar", 4802 "href": "http://example.org/foo/bar", 4803 "origin": "http://example.org", 4804 "protocol": "http:", 4805 "username": "", 4806 "password": "", 4807 "host": "example.org", 4808 "hostname": "example.org", 4809 "port": "", 4810 "pathname": "/foo/bar", 4811 "search": "", 4812 "searchParams": "", 4813 "hash": "" 4814 }, 4815 { 4816 "input": "http:", 4817 "base": "https://example.org/foo/bar", 4818 "failure": true 4819 }, 4820 { 4821 "input": "sc:", 4822 "base": "https://example.org/foo/bar", 4823 "href": "sc:", 4824 "origin": "null", 4825 "protocol": "sc:", 4826 "username": "", 4827 "password": "", 4828 "host": "", 4829 "hostname": "", 4830 "port": "", 4831 "pathname": "", 4832 "search": "", 4833 "searchParams": "", 4834 "hash": "" 4835 }, 4836 "# Percent encoding of fragments", 4837 { 4838 "input": "http://foo.bar/baz?qux#foo\bbar", 4839 "base": "about:blank", 4840 "href": "http://foo.bar/baz?qux#foo%08bar", 4841 "origin": "http://foo.bar", 4842 "protocol": "http:", 4843 "username": "", 4844 "password": "", 4845 "host": "foo.bar", 4846 "hostname": "foo.bar", 4847 "port": "", 4848 "pathname": "/baz", 4849 "search": "?qux", 4850 "searchParams": "qux=", 4851 "hash": "#foo%08bar" 4852 }, 4853 { 4854 "input": "http://foo.bar/baz?qux#foo\"bar", 4855 "base": "about:blank", 4856 "href": "http://foo.bar/baz?qux#foo%22bar", 4857 "origin": "http://foo.bar", 4858 "protocol": "http:", 4859 "username": "", 4860 "password": "", 4861 "host": "foo.bar", 4862 "hostname": "foo.bar", 4863 "port": "", 4864 "pathname": "/baz", 4865 "search": "?qux", 4866 "searchParams": "qux=", 4867 "hash": "#foo%22bar" 4868 }, 4869 { 4870 "input": "http://foo.bar/baz?qux#foo<bar", 4871 "base": "about:blank", 4872 "href": "http://foo.bar/baz?qux#foo%3Cbar", 4873 "origin": "http://foo.bar", 4874 "protocol": "http:", 4875 "username": "", 4876 "password": "", 4877 "host": "foo.bar", 4878 "hostname": "foo.bar", 4879 "port": "", 4880 "pathname": "/baz", 4881 "search": "?qux", 4882 "searchParams": "qux=", 4883 "hash": "#foo%3Cbar" 4884 }, 4885 { 4886 "input": "http://foo.bar/baz?qux#foo>bar", 4887 "base": "about:blank", 4888 "href": "http://foo.bar/baz?qux#foo%3Ebar", 4889 "origin": "http://foo.bar", 4890 "protocol": "http:", 4891 "username": "", 4892 "password": "", 4893 "host": "foo.bar", 4894 "hostname": "foo.bar", 4895 "port": "", 4896 "pathname": "/baz", 4897 "search": "?qux", 4898 "searchParams": "qux=", 4899 "hash": "#foo%3Ebar" 4900 }, 4901 { 4902 "input": "http://foo.bar/baz?qux#foo`bar", 4903 "base": "about:blank", 4904 "href": "http://foo.bar/baz?qux#foo%60bar", 4905 "origin": "http://foo.bar", 4906 "protocol": "http:", 4907 "username": "", 4908 "password": "", 4909 "host": "foo.bar", 4910 "hostname": "foo.bar", 4911 "port": "", 4912 "pathname": "/baz", 4913 "search": "?qux", 4914 "searchParams": "qux=", 4915 "hash": "#foo%60bar" 4916 }, 4917 "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)", 4918 { 4919 "input": "http://192.168.257", 4920 "base": "http://other.com/", 4921 "href": "http://192.168.1.1/", 4922 "origin": "http://192.168.1.1", 4923 "protocol": "http:", 4924 "username": "", 4925 "password": "", 4926 "host": "192.168.1.1", 4927 "hostname": "192.168.1.1", 4928 "port": "", 4929 "pathname": "/", 4930 "search": "", 4931 "hash": "" 4932 }, 4933 { 4934 "input": "http://192.168.257.com", 4935 "base": "http://other.com/", 4936 "href": "http://192.168.257.com/", 4937 "origin": "http://192.168.257.com", 4938 "protocol": "http:", 4939 "username": "", 4940 "password": "", 4941 "host": "192.168.257.com", 4942 "hostname": "192.168.257.com", 4943 "port": "", 4944 "pathname": "/", 4945 "search": "", 4946 "hash": "" 4947 }, 4948 { 4949 "input": "http://256", 4950 "base": "http://other.com/", 4951 "href": "http://0.0.1.0/", 4952 "origin": "http://0.0.1.0", 4953 "protocol": "http:", 4954 "username": "", 4955 "password": "", 4956 "host": "0.0.1.0", 4957 "hostname": "0.0.1.0", 4958 "port": "", 4959 "pathname": "/", 4960 "search": "", 4961 "hash": "" 4962 }, 4963 { 4964 "input": "http://256.com", 4965 "base": "http://other.com/", 4966 "href": "http://256.com/", 4967 "origin": "http://256.com", 4968 "protocol": "http:", 4969 "username": "", 4970 "password": "", 4971 "host": "256.com", 4972 "hostname": "256.com", 4973 "port": "", 4974 "pathname": "/", 4975 "search": "", 4976 "hash": "" 4977 }, 4978 { 4979 "input": "http://999999999", 4980 "base": "http://other.com/", 4981 "href": "http://59.154.201.255/", 4982 "origin": "http://59.154.201.255", 4983 "protocol": "http:", 4984 "username": "", 4985 "password": "", 4986 "host": "59.154.201.255", 4987 "hostname": "59.154.201.255", 4988 "port": "", 4989 "pathname": "/", 4990 "search": "", 4991 "hash": "" 4992 }, 4993 { 4994 "input": "http://999999999.com", 4995 "base": "http://other.com/", 4996 "href": "http://999999999.com/", 4997 "origin": "http://999999999.com", 4998 "protocol": "http:", 4999 "username": "", 5000 "password": "", 5001 "host": "999999999.com", 5002 "hostname": "999999999.com", 5003 "port": "", 5004 "pathname": "/", 5005 "search": "", 5006 "hash": "" 5007 }, 5008 { 5009 "input": "http://10000000000", 5010 "base": "http://other.com/", 5011 "failure": true 5012 }, 5013 { 5014 "input": "http://10000000000.com", 5015 "base": "http://other.com/", 5016 "href": "http://10000000000.com/", 5017 "origin": "http://10000000000.com", 5018 "protocol": "http:", 5019 "username": "", 5020 "password": "", 5021 "host": "10000000000.com", 5022 "hostname": "10000000000.com", 5023 "port": "", 5024 "pathname": "/", 5025 "search": "", 5026 "hash": "" 5027 }, 5028 { 5029 "input": "http://4294967295", 5030 "base": "http://other.com/", 5031 "href": "http://255.255.255.255/", 5032 "origin": "http://255.255.255.255", 5033 "protocol": "http:", 5034 "username": "", 5035 "password": "", 5036 "host": "255.255.255.255", 5037 "hostname": "255.255.255.255", 5038 "port": "", 5039 "pathname": "/", 5040 "search": "", 5041 "hash": "" 5042 }, 5043 { 5044 "input": "http://4294967296", 5045 "base": "http://other.com/", 5046 "failure": true 5047 }, 5048 { 5049 "input": "http://0xffffffff", 5050 "base": "http://other.com/", 5051 "href": "http://255.255.255.255/", 5052 "origin": "http://255.255.255.255", 5053 "protocol": "http:", 5054 "username": "", 5055 "password": "", 5056 "host": "255.255.255.255", 5057 "hostname": "255.255.255.255", 5058 "port": "", 5059 "pathname": "/", 5060 "search": "", 5061 "hash": "" 5062 }, 5063 { 5064 "input": "http://0xffffffff1", 5065 "base": "http://other.com/", 5066 "failure": true 5067 }, 5068 { 5069 "input": "http://256.256.256.256", 5070 "base": "http://other.com/", 5071 "failure": true 5072 }, 5073 { 5074 "input": "http://256.256.256.256.256", 5075 "base": "http://other.com/", 5076 "href": "http://256.256.256.256.256/", 5077 "origin": "http://256.256.256.256.256", 5078 "protocol": "http:", 5079 "username": "", 5080 "password": "", 5081 "host": "256.256.256.256.256", 5082 "hostname": "256.256.256.256.256", 5083 "port": "", 5084 "pathname": "/", 5085 "search": "", 5086 "hash": "" 5087 }, 5088 { 5089 "input": "https://0x.0x.0", 5090 "base": "about:blank", 5091 "href": "https://0.0.0.0/", 5092 "origin": "https://0.0.0.0", 5093 "protocol": "https:", 5094 "username": "", 5095 "password": "", 5096 "host": "0.0.0.0", 5097 "hostname": "0.0.0.0", 5098 "port": "", 5099 "pathname": "/", 5100 "search": "", 5101 "hash": "" 5102 }, 5103 "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)", 5104 { 5105 "input": "https://0x100000000/test", 5106 "base": "about:blank", 5107 "failure": true 5108 }, 5109 { 5110 "input": "https://256.0.0.1/test", 5111 "base": "about:blank", 5112 "failure": true 5113 }, 5114 "# file URLs containing percent-encoded Windows drive letters (shouldn't work)", 5115 { 5116 "input": "file:///C%3A/", 5117 "base": "about:blank", 5118 "href": "file:///C%3A/", 5119 "protocol": "file:", 5120 "username": "", 5121 "password": "", 5122 "host": "", 5123 "hostname": "", 5124 "port": "", 5125 "pathname": "/C%3A/", 5126 "search": "", 5127 "hash": "" 5128 }, 5129 { 5130 "input": "file:///C%7C/", 5131 "base": "about:blank", 5132 "href": "file:///C%7C/", 5133 "protocol": "file:", 5134 "username": "", 5135 "password": "", 5136 "host": "", 5137 "hostname": "", 5138 "port": "", 5139 "pathname": "/C%7C/", 5140 "search": "", 5141 "hash": "" 5142 }, 5143 "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)", 5144 { 5145 "input": "pix/submit.gif", 5146 "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html", 5147 "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif", 5148 "protocol": "file:", 5149 "username": "", 5150 "password": "", 5151 "host": "", 5152 "hostname": "", 5153 "port": "", 5154 "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif", 5155 "search": "", 5156 "hash": "" 5157 }, 5158 { 5159 "input": "..", 5160 "base": "file:///C:/", 5161 "href": "file:///C:/", 5162 "protocol": "file:", 5163 "username": "", 5164 "password": "", 5165 "host": "", 5166 "hostname": "", 5167 "port": "", 5168 "pathname": "/C:/", 5169 "search": "", 5170 "hash": "" 5171 }, 5172 { 5173 "input": "..", 5174 "base": "file:///", 5175 "href": "file:///", 5176 "protocol": "file:", 5177 "username": "", 5178 "password": "", 5179 "host": "", 5180 "hostname": "", 5181 "port": "", 5182 "pathname": "/", 5183 "search": "", 5184 "hash": "" 5185 }, 5186 "# More file URL tests by zcorpan and annevk", 5187 { 5188 "input": "/", 5189 "base": "file:///C:/a/b", 5190 "href": "file:///C:/", 5191 "protocol": "file:", 5192 "username": "", 5193 "password": "", 5194 "host": "", 5195 "hostname": "", 5196 "port": "", 5197 "pathname": "/C:/", 5198 "search": "", 5199 "hash": "" 5200 }, 5201 { 5202 "input": "//d:", 5203 "base": "file:///C:/a/b", 5204 "href": "file:///d:", 5205 "protocol": "file:", 5206 "username": "", 5207 "password": "", 5208 "host": "", 5209 "hostname": "", 5210 "port": "", 5211 "pathname": "/d:", 5212 "search": "", 5213 "hash": "" 5214 }, 5215 { 5216 "input": "//d:/..", 5217 "base": "file:///C:/a/b", 5218 "href": "file:///d:/", 5219 "protocol": "file:", 5220 "username": "", 5221 "password": "", 5222 "host": "", 5223 "hostname": "", 5224 "port": "", 5225 "pathname": "/d:/", 5226 "search": "", 5227 "hash": "" 5228 }, 5229 { 5230 "input": "..", 5231 "base": "file:///ab:/", 5232 "href": "file:///", 5233 "protocol": "file:", 5234 "username": "", 5235 "password": "", 5236 "host": "", 5237 "hostname": "", 5238 "port": "", 5239 "pathname": "/", 5240 "search": "", 5241 "hash": "" 5242 }, 5243 { 5244 "input": "..", 5245 "base": "file:///1:/", 5246 "href": "file:///", 5247 "protocol": "file:", 5248 "username": "", 5249 "password": "", 5250 "host": "", 5251 "hostname": "", 5252 "port": "", 5253 "pathname": "/", 5254 "search": "", 5255 "hash": "" 5256 }, 5257 { 5258 "input": "", 5259 "base": "file:///test?test#test", 5260 "href": "file:///test?test", 5261 "protocol": "file:", 5262 "username": "", 5263 "password": "", 5264 "host": "", 5265 "hostname": "", 5266 "port": "", 5267 "pathname": "/test", 5268 "search": "?test", 5269 "hash": "" 5270 }, 5271 { 5272 "input": "file:", 5273 "base": "file:///test?test#test", 5274 "href": "file:///test?test", 5275 "protocol": "file:", 5276 "username": "", 5277 "password": "", 5278 "host": "", 5279 "hostname": "", 5280 "port": "", 5281 "pathname": "/test", 5282 "search": "?test", 5283 "hash": "" 5284 }, 5285 { 5286 "input": "?x", 5287 "base": "file:///test?test#test", 5288 "href": "file:///test?x", 5289 "protocol": "file:", 5290 "username": "", 5291 "password": "", 5292 "host": "", 5293 "hostname": "", 5294 "port": "", 5295 "pathname": "/test", 5296 "search": "?x", 5297 "hash": "" 5298 }, 5299 { 5300 "input": "file:?x", 5301 "base": "file:///test?test#test", 5302 "href": "file:///test?x", 5303 "protocol": "file:", 5304 "username": "", 5305 "password": "", 5306 "host": "", 5307 "hostname": "", 5308 "port": "", 5309 "pathname": "/test", 5310 "search": "?x", 5311 "hash": "" 5312 }, 5313 { 5314 "input": "#x", 5315 "base": "file:///test?test#test", 5316 "href": "file:///test?test#x", 5317 "protocol": "file:", 5318 "username": "", 5319 "password": "", 5320 "host": "", 5321 "hostname": "", 5322 "port": "", 5323 "pathname": "/test", 5324 "search": "?test", 5325 "hash": "#x" 5326 }, 5327 { 5328 "input": "file:#x", 5329 "base": "file:///test?test#test", 5330 "href": "file:///test?test#x", 5331 "protocol": "file:", 5332 "username": "", 5333 "password": "", 5334 "host": "", 5335 "hostname": "", 5336 "port": "", 5337 "pathname": "/test", 5338 "search": "?test", 5339 "hash": "#x" 5340 }, 5341 "# File URLs and many (back)slashes", 5342 { 5343 "input": "file:\\\\//", 5344 "base": "about:blank", 5345 "href": "file:///", 5346 "protocol": "file:", 5347 "username": "", 5348 "password": "", 5349 "host": "", 5350 "hostname": "", 5351 "port": "", 5352 "pathname": "/", 5353 "search": "", 5354 "hash": "" 5355 }, 5356 { 5357 "input": "file:\\\\\\\\", 5358 "base": "about:blank", 5359 "href": "file:///", 5360 "protocol": "file:", 5361 "username": "", 5362 "password": "", 5363 "host": "", 5364 "hostname": "", 5365 "port": "", 5366 "pathname": "/", 5367 "search": "", 5368 "hash": "" 5369 }, 5370 { 5371 "input": "file:\\\\\\\\?fox", 5372 "base": "about:blank", 5373 "href": "file:///?fox", 5374 "protocol": "file:", 5375 "username": "", 5376 "password": "", 5377 "host": "", 5378 "hostname": "", 5379 "port": "", 5380 "pathname": "/", 5381 "search": "?fox", 5382 "hash": "" 5383 }, 5384 { 5385 "input": "file:\\\\\\\\#guppy", 5386 "base": "about:blank", 5387 "href": "file:///#guppy", 5388 "protocol": "file:", 5389 "username": "", 5390 "password": "", 5391 "host": "", 5392 "hostname": "", 5393 "port": "", 5394 "pathname": "/", 5395 "search": "", 5396 "hash": "#guppy" 5397 }, 5398 { 5399 "input": "file://spider///", 5400 "base": "about:blank", 5401 "href": "file://spider/", 5402 "protocol": "file:", 5403 "username": "", 5404 "password": "", 5405 "host": "spider", 5406 "hostname": "spider", 5407 "port": "", 5408 "pathname": "/", 5409 "search": "", 5410 "hash": "" 5411 }, 5412 { 5413 "input": "file:\\\\localhost//", 5414 "base": "about:blank", 5415 "href": "file:///", 5416 "protocol": "file:", 5417 "username": "", 5418 "password": "", 5419 "host": "", 5420 "hostname": "", 5421 "port": "", 5422 "pathname": "/", 5423 "search": "", 5424 "hash": "" 5425 }, 5426 { 5427 "input": "file:///localhost//cat", 5428 "base": "about:blank", 5429 "href": "file:///localhost//cat", 5430 "protocol": "file:", 5431 "username": "", 5432 "password": "", 5433 "host": "", 5434 "hostname": "", 5435 "port": "", 5436 "pathname": "/localhost//cat", 5437 "search": "", 5438 "hash": "" 5439 }, 5440 { 5441 "input": "file://\\/localhost//cat", 5442 "base": "about:blank", 5443 "href": "file:///localhost//cat", 5444 "protocol": "file:", 5445 "username": "", 5446 "password": "", 5447 "host": "", 5448 "hostname": "", 5449 "port": "", 5450 "pathname": "/localhost//cat", 5451 "search": "", 5452 "hash": "" 5453 }, 5454 { 5455 "input": "file://localhost//a//../..//", 5456 "base": "about:blank", 5457 "href": "file:///", 5458 "protocol": "file:", 5459 "username": "", 5460 "password": "", 5461 "host": "", 5462 "hostname": "", 5463 "port": "", 5464 "pathname": "/", 5465 "search": "", 5466 "hash": "" 5467 }, 5468 { 5469 "input": "/////mouse", 5470 "base": "file:///elephant", 5471 "href": "file:///mouse", 5472 "protocol": "file:", 5473 "username": "", 5474 "password": "", 5475 "host": "", 5476 "hostname": "", 5477 "port": "", 5478 "pathname": "/mouse", 5479 "search": "", 5480 "hash": "" 5481 }, 5482 { 5483 "input": "\\//pig", 5484 "base": "file://lion/", 5485 "href": "file:///pig", 5486 "protocol": "file:", 5487 "username": "", 5488 "password": "", 5489 "host": "", 5490 "hostname": "", 5491 "port": "", 5492 "pathname": "/pig", 5493 "search": "", 5494 "hash": "" 5495 }, 5496 { 5497 "input": "\\/localhost//pig", 5498 "base": "file://lion/", 5499 "href": "file:///pig", 5500 "protocol": "file:", 5501 "username": "", 5502 "password": "", 5503 "host": "", 5504 "hostname": "", 5505 "port": "", 5506 "pathname": "/pig", 5507 "search": "", 5508 "hash": "" 5509 }, 5510 { 5511 "input": "//localhost//pig", 5512 "base": "file://lion/", 5513 "href": "file:///pig", 5514 "protocol": "file:", 5515 "username": "", 5516 "password": "", 5517 "host": "", 5518 "hostname": "", 5519 "port": "", 5520 "pathname": "/pig", 5521 "search": "", 5522 "hash": "" 5523 }, 5524 { 5525 "input": "/..//localhost//pig", 5526 "base": "file://lion/", 5527 "href": "file://lion/localhost//pig", 5528 "protocol": "file:", 5529 "username": "", 5530 "password": "", 5531 "host": "lion", 5532 "hostname": "lion", 5533 "port": "", 5534 "pathname": "/localhost//pig", 5535 "search": "", 5536 "hash": "" 5537 }, 5538 { 5539 "input": "file://", 5540 "base": "file://ape/", 5541 "href": "file:///", 5542 "protocol": "file:", 5543 "username": "", 5544 "password": "", 5545 "host": "", 5546 "hostname": "", 5547 "port": "", 5548 "pathname": "/", 5549 "search": "", 5550 "hash": "" 5551 }, 5552 "# File URLs with non-empty hosts", 5553 { 5554 "input": "/rooibos", 5555 "base": "file://tea/", 5556 "href": "file://tea/rooibos", 5557 "protocol": "file:", 5558 "username": "", 5559 "password": "", 5560 "host": "tea", 5561 "hostname": "tea", 5562 "port": "", 5563 "pathname": "/rooibos", 5564 "search": "", 5565 "hash": "" 5566 }, 5567 { 5568 "input": "/?chai", 5569 "base": "file://tea/", 5570 "href": "file://tea/?chai", 5571 "protocol": "file:", 5572 "username": "", 5573 "password": "", 5574 "host": "tea", 5575 "hostname": "tea", 5576 "port": "", 5577 "pathname": "/", 5578 "search": "?chai", 5579 "hash": "" 5580 }, 5581 "# Windows drive letter handling with the 'file:' base URL", 5582 { 5583 "input": "C|", 5584 "base": "file://host/dir/file", 5585 "href": "file:///C:", 5586 "protocol": "file:", 5587 "username": "", 5588 "password": "", 5589 "host": "", 5590 "hostname": "", 5591 "port": "", 5592 "pathname": "/C:", 5593 "search": "", 5594 "hash": "" 5595 }, 5596 { 5597 "input": "C|#", 5598 "base": "file://host/dir/file", 5599 "href": "file:///C:#", 5600 "protocol": "file:", 5601 "username": "", 5602 "password": "", 5603 "host": "", 5604 "hostname": "", 5605 "port": "", 5606 "pathname": "/C:", 5607 "search": "", 5608 "hash": "" 5609 }, 5610 { 5611 "input": "C|?", 5612 "base": "file://host/dir/file", 5613 "href": "file:///C:?", 5614 "protocol": "file:", 5615 "username": "", 5616 "password": "", 5617 "host": "", 5618 "hostname": "", 5619 "port": "", 5620 "pathname": "/C:", 5621 "search": "", 5622 "hash": "" 5623 }, 5624 { 5625 "input": "C|/", 5626 "base": "file://host/dir/file", 5627 "href": "file:///C:/", 5628 "protocol": "file:", 5629 "username": "", 5630 "password": "", 5631 "host": "", 5632 "hostname": "", 5633 "port": "", 5634 "pathname": "/C:/", 5635 "search": "", 5636 "hash": "" 5637 }, 5638 { 5639 "input": "C|\n/", 5640 "base": "file://host/dir/file", 5641 "href": "file:///C:/", 5642 "protocol": "file:", 5643 "username": "", 5644 "password": "", 5645 "host": "", 5646 "hostname": "", 5647 "port": "", 5648 "pathname": "/C:/", 5649 "search": "", 5650 "hash": "" 5651 }, 5652 { 5653 "input": "C|\\", 5654 "base": "file://host/dir/file", 5655 "href": "file:///C:/", 5656 "protocol": "file:", 5657 "username": "", 5658 "password": "", 5659 "host": "", 5660 "hostname": "", 5661 "port": "", 5662 "pathname": "/C:/", 5663 "search": "", 5664 "hash": "" 5665 }, 5666 { 5667 "input": "C", 5668 "base": "file://host/dir/file", 5669 "href": "file://host/dir/C", 5670 "protocol": "file:", 5671 "username": "", 5672 "password": "", 5673 "host": "host", 5674 "hostname": "host", 5675 "port": "", 5676 "pathname": "/dir/C", 5677 "search": "", 5678 "hash": "" 5679 }, 5680 { 5681 "input": "C|a", 5682 "base": "file://host/dir/file", 5683 "href": "file://host/dir/C|a", 5684 "protocol": "file:", 5685 "username": "", 5686 "password": "", 5687 "host": "host", 5688 "hostname": "host", 5689 "port": "", 5690 "pathname": "/dir/C|a", 5691 "search": "", 5692 "hash": "" 5693 }, 5694 "# Windows drive letter quirk in the file slash state", 5695 { 5696 "input": "/c:/foo/bar", 5697 "base": "file:///c:/baz/qux", 5698 "href": "file:///c:/foo/bar", 5699 "protocol": "file:", 5700 "username": "", 5701 "password": "", 5702 "host": "", 5703 "hostname": "", 5704 "port": "", 5705 "pathname": "/c:/foo/bar", 5706 "search": "", 5707 "hash": "" 5708 }, 5709 { 5710 "input": "/c|/foo/bar", 5711 "base": "file:///c:/baz/qux", 5712 "href": "file:///c:/foo/bar", 5713 "protocol": "file:", 5714 "username": "", 5715 "password": "", 5716 "host": "", 5717 "hostname": "", 5718 "port": "", 5719 "pathname": "/c:/foo/bar", 5720 "search": "", 5721 "hash": "" 5722 }, 5723 { 5724 "input": "file:\\c:\\foo\\bar", 5725 "base": "file:///c:/baz/qux", 5726 "href": "file:///c:/foo/bar", 5727 "protocol": "file:", 5728 "username": "", 5729 "password": "", 5730 "host": "", 5731 "hostname": "", 5732 "port": "", 5733 "pathname": "/c:/foo/bar", 5734 "search": "", 5735 "hash": "" 5736 }, 5737 { 5738 "input": "/c:/foo/bar", 5739 "base": "file://host/path", 5740 "href": "file:///c:/foo/bar", 5741 "protocol": "file:", 5742 "username": "", 5743 "password": "", 5744 "host": "", 5745 "hostname": "", 5746 "port": "", 5747 "pathname": "/c:/foo/bar", 5748 "search": "", 5749 "hash": "" 5750 }, 5751 "# Windows drive letter quirk with not empty host", 5752 { 5753 "input": "file://example.net/C:/", 5754 "base": "about:blank", 5755 "href": "file:///C:/", 5756 "protocol": "file:", 5757 "username": "", 5758 "password": "", 5759 "host": "", 5760 "hostname": "", 5761 "port": "", 5762 "pathname": "/C:/", 5763 "search": "", 5764 "hash": "" 5765 }, 5766 { 5767 "input": "file://1.2.3.4/C:/", 5768 "base": "about:blank", 5769 "href": "file:///C:/", 5770 "protocol": "file:", 5771 "username": "", 5772 "password": "", 5773 "host": "", 5774 "hostname": "", 5775 "port": "", 5776 "pathname": "/C:/", 5777 "search": "", 5778 "hash": "" 5779 }, 5780 { 5781 "input": "file://[1::8]/C:/", 5782 "base": "about:blank", 5783 "href": "file:///C:/", 5784 "protocol": "file:", 5785 "username": "", 5786 "password": "", 5787 "host": "", 5788 "hostname": "", 5789 "port": "", 5790 "pathname": "/C:/", 5791 "search": "", 5792 "hash": "" 5793 }, 5794 "# Windows drive letter quirk (no host)", 5795 { 5796 "input": "file:/C|/", 5797 "base": "about:blank", 5798 "href": "file:///C:/", 5799 "protocol": "file:", 5800 "username": "", 5801 "password": "", 5802 "host": "", 5803 "hostname": "", 5804 "port": "", 5805 "pathname": "/C:/", 5806 "search": "", 5807 "hash": "" 5808 }, 5809 { 5810 "input": "file://C|/", 5811 "base": "about:blank", 5812 "href": "file:///C:/", 5813 "protocol": "file:", 5814 "username": "", 5815 "password": "", 5816 "host": "", 5817 "hostname": "", 5818 "port": "", 5819 "pathname": "/C:/", 5820 "search": "", 5821 "hash": "" 5822 }, 5823 "# file URLs without base URL by Rimas Misevičius", 5824 { 5825 "input": "file:", 5826 "base": "about:blank", 5827 "href": "file:///", 5828 "protocol": "file:", 5829 "username": "", 5830 "password": "", 5831 "host": "", 5832 "hostname": "", 5833 "port": "", 5834 "pathname": "/", 5835 "search": "", 5836 "hash": "" 5837 }, 5838 { 5839 "input": "file:?q=v", 5840 "base": "about:blank", 5841 "href": "file:///?q=v", 5842 "protocol": "file:", 5843 "username": "", 5844 "password": "", 5845 "host": "", 5846 "hostname": "", 5847 "port": "", 5848 "pathname": "/", 5849 "search": "?q=v", 5850 "hash": "" 5851 }, 5852 { 5853 "input": "file:#frag", 5854 "base": "about:blank", 5855 "href": "file:///#frag", 5856 "protocol": "file:", 5857 "username": "", 5858 "password": "", 5859 "host": "", 5860 "hostname": "", 5861 "port": "", 5862 "pathname": "/", 5863 "search": "", 5864 "hash": "#frag" 5865 }, 5866 "# IPv6 tests", 5867 { 5868 "input": "http://[1:0::]", 5869 "base": "http://example.net/", 5870 "href": "http://[1::]/", 5871 "origin": "http://[1::]", 5872 "protocol": "http:", 5873 "username": "", 5874 "password": "", 5875 "host": "[1::]", 5876 "hostname": "[1::]", 5877 "port": "", 5878 "pathname": "/", 5879 "search": "", 5880 "hash": "" 5881 }, 5882 { 5883 "input": "http://[0:1:2:3:4:5:6:7:8]", 5884 "base": "http://example.net/", 5885 "failure": true 5886 }, 5887 { 5888 "input": "https://[0::0::0]", 5889 "base": "about:blank", 5890 "failure": true 5891 }, 5892 { 5893 "input": "https://[0:.0]", 5894 "base": "about:blank", 5895 "failure": true 5896 }, 5897 { 5898 "input": "https://[0:0:]", 5899 "base": "about:blank", 5900 "failure": true 5901 }, 5902 { 5903 "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]", 5904 "base": "about:blank", 5905 "failure": true 5906 }, 5907 { 5908 "input": "https://[0:1.00.0.0.0]", 5909 "base": "about:blank", 5910 "failure": true 5911 }, 5912 { 5913 "input": "https://[0:1.290.0.0.0]", 5914 "base": "about:blank", 5915 "failure": true 5916 }, 5917 { 5918 "input": "https://[0:1.23.23]", 5919 "base": "about:blank", 5920 "failure": true 5921 }, 5922 "# Empty host", 5923 { 5924 "input": "http://?", 5925 "base": "about:blank", 5926 "failure": true 5927 }, 5928 { 5929 "input": "http://#", 5930 "base": "about:blank", 5931 "failure": true 5932 }, 5933 "Port overflow (2^32 + 81)", 5934 { 5935 "input": "http://f:4294967377/c", 5936 "base": "http://example.org/", 5937 "failure": true 5938 }, 5939 "Port overflow (2^64 + 81)", 5940 { 5941 "input": "http://f:18446744073709551697/c", 5942 "base": "http://example.org/", 5943 "failure": true 5944 }, 5945 "Port overflow (2^128 + 81)", 5946 { 5947 "input": "http://f:340282366920938463463374607431768211537/c", 5948 "base": "http://example.org/", 5949 "failure": true 5950 }, 5951 "# Non-special-URL path tests", 5952 { 5953 "input": "sc://ñ", 5954 "base": "about:blank", 5955 "href": "sc://%C3%B1", 5956 "origin": "null", 5957 "protocol": "sc:", 5958 "username": "", 5959 "password": "", 5960 "host": "%C3%B1", 5961 "hostname": "%C3%B1", 5962 "port": "", 5963 "pathname": "", 5964 "search": "", 5965 "hash": "" 5966 }, 5967 { 5968 "input": "sc://ñ?x", 5969 "base": "about:blank", 5970 "href": "sc://%C3%B1?x", 5971 "origin": "null", 5972 "protocol": "sc:", 5973 "username": "", 5974 "password": "", 5975 "host": "%C3%B1", 5976 "hostname": "%C3%B1", 5977 "port": "", 5978 "pathname": "", 5979 "search": "?x", 5980 "hash": "" 5981 }, 5982 { 5983 "input": "sc://ñ#x", 5984 "base": "about:blank", 5985 "href": "sc://%C3%B1#x", 5986 "origin": "null", 5987 "protocol": "sc:", 5988 "username": "", 5989 "password": "", 5990 "host": "%C3%B1", 5991 "hostname": "%C3%B1", 5992 "port": "", 5993 "pathname": "", 5994 "search": "", 5995 "hash": "#x" 5996 }, 5997 { 5998 "input": "#x", 5999 "base": "sc://ñ", 6000 "href": "sc://%C3%B1#x", 6001 "origin": "null", 6002 "protocol": "sc:", 6003 "username": "", 6004 "password": "", 6005 "host": "%C3%B1", 6006 "hostname": "%C3%B1", 6007 "port": "", 6008 "pathname": "", 6009 "search": "", 6010 "hash": "#x" 6011 }, 6012 { 6013 "input": "?x", 6014 "base": "sc://ñ", 6015 "href": "sc://%C3%B1?x", 6016 "origin": "null", 6017 "protocol": "sc:", 6018 "username": "", 6019 "password": "", 6020 "host": "%C3%B1", 6021 "hostname": "%C3%B1", 6022 "port": "", 6023 "pathname": "", 6024 "search": "?x", 6025 "hash": "" 6026 }, 6027 { 6028 "input": "sc://?", 6029 "base": "about:blank", 6030 "href": "sc://?", 6031 "protocol": "sc:", 6032 "username": "", 6033 "password": "", 6034 "host": "", 6035 "hostname": "", 6036 "port": "", 6037 "pathname": "", 6038 "search": "", 6039 "hash": "" 6040 }, 6041 { 6042 "input": "sc://#", 6043 "base": "about:blank", 6044 "href": "sc://#", 6045 "protocol": "sc:", 6046 "username": "", 6047 "password": "", 6048 "host": "", 6049 "hostname": "", 6050 "port": "", 6051 "pathname": "", 6052 "search": "", 6053 "hash": "" 6054 }, 6055 { 6056 "input": "///", 6057 "base": "sc://x/", 6058 "href": "sc:///", 6059 "protocol": "sc:", 6060 "username": "", 6061 "password": "", 6062 "host": "", 6063 "hostname": "", 6064 "port": "", 6065 "pathname": "/", 6066 "search": "", 6067 "hash": "" 6068 }, 6069 { 6070 "input": "////", 6071 "base": "sc://x/", 6072 "href": "sc:////", 6073 "protocol": "sc:", 6074 "username": "", 6075 "password": "", 6076 "host": "", 6077 "hostname": "", 6078 "port": "", 6079 "pathname": "//", 6080 "search": "", 6081 "hash": "" 6082 }, 6083 { 6084 "input": "////x/", 6085 "base": "sc://x/", 6086 "href": "sc:////x/", 6087 "protocol": "sc:", 6088 "username": "", 6089 "password": "", 6090 "host": "", 6091 "hostname": "", 6092 "port": "", 6093 "pathname": "//x/", 6094 "search": "", 6095 "hash": "" 6096 }, 6097 { 6098 "input": "tftp://foobar.com/someconfig;mode=netascii", 6099 "base": "about:blank", 6100 "href": "tftp://foobar.com/someconfig;mode=netascii", 6101 "origin": "null", 6102 "protocol": "tftp:", 6103 "username": "", 6104 "password": "", 6105 "host": "foobar.com", 6106 "hostname": "foobar.com", 6107 "port": "", 6108 "pathname": "/someconfig;mode=netascii", 6109 "search": "", 6110 "hash": "" 6111 }, 6112 { 6113 "input": "telnet://user:pass@foobar.com:23/", 6114 "base": "about:blank", 6115 "href": "telnet://user:pass@foobar.com:23/", 6116 "origin": "null", 6117 "protocol": "telnet:", 6118 "username": "user", 6119 "password": "pass", 6120 "host": "foobar.com:23", 6121 "hostname": "foobar.com", 6122 "port": "23", 6123 "pathname": "/", 6124 "search": "", 6125 "hash": "" 6126 }, 6127 { 6128 "input": "ut2004://10.10.10.10:7777/Index.ut2", 6129 "base": "about:blank", 6130 "href": "ut2004://10.10.10.10:7777/Index.ut2", 6131 "origin": "null", 6132 "protocol": "ut2004:", 6133 "username": "", 6134 "password": "", 6135 "host": "10.10.10.10:7777", 6136 "hostname": "10.10.10.10", 6137 "port": "7777", 6138 "pathname": "/Index.ut2", 6139 "search": "", 6140 "hash": "" 6141 }, 6142 { 6143 "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", 6144 "base": "about:blank", 6145 "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz", 6146 "origin": "null", 6147 "protocol": "redis:", 6148 "username": "foo", 6149 "password": "bar", 6150 "host": "somehost:6379", 6151 "hostname": "somehost", 6152 "port": "6379", 6153 "pathname": "/0", 6154 "search": "?baz=bam&qux=baz", 6155 "hash": "" 6156 }, 6157 { 6158 "input": "rsync://foo@host:911/sup", 6159 "base": "about:blank", 6160 "href": "rsync://foo@host:911/sup", 6161 "origin": "null", 6162 "protocol": "rsync:", 6163 "username": "foo", 6164 "password": "", 6165 "host": "host:911", 6166 "hostname": "host", 6167 "port": "911", 6168 "pathname": "/sup", 6169 "search": "", 6170 "hash": "" 6171 }, 6172 { 6173 "input": "git://github.com/foo/bar.git", 6174 "base": "about:blank", 6175 "href": "git://github.com/foo/bar.git", 6176 "origin": "null", 6177 "protocol": "git:", 6178 "username": "", 6179 "password": "", 6180 "host": "github.com", 6181 "hostname": "github.com", 6182 "port": "", 6183 "pathname": "/foo/bar.git", 6184 "search": "", 6185 "hash": "" 6186 }, 6187 { 6188 "input": "irc://myserver.com:6999/channel?passwd", 6189 "base": "about:blank", 6190 "href": "irc://myserver.com:6999/channel?passwd", 6191 "origin": "null", 6192 "protocol": "irc:", 6193 "username": "", 6194 "password": "", 6195 "host": "myserver.com:6999", 6196 "hostname": "myserver.com", 6197 "port": "6999", 6198 "pathname": "/channel", 6199 "search": "?passwd", 6200 "hash": "" 6201 }, 6202 { 6203 "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT", 6204 "base": "about:blank", 6205 "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT", 6206 "origin": "null", 6207 "protocol": "dns:", 6208 "username": "", 6209 "password": "", 6210 "host": "fw.example.org:9999", 6211 "hostname": "fw.example.org", 6212 "port": "9999", 6213 "pathname": "/foo.bar.org", 6214 "search": "?type=TXT", 6215 "hash": "" 6216 }, 6217 { 6218 "input": "ldap://localhost:389/ou=People,o=JNDITutorial", 6219 "base": "about:blank", 6220 "href": "ldap://localhost:389/ou=People,o=JNDITutorial", 6221 "origin": "null", 6222 "protocol": "ldap:", 6223 "username": "", 6224 "password": "", 6225 "host": "localhost:389", 6226 "hostname": "localhost", 6227 "port": "389", 6228 "pathname": "/ou=People,o=JNDITutorial", 6229 "search": "", 6230 "hash": "" 6231 }, 6232 { 6233 "input": "git+https://github.com/foo/bar", 6234 "base": "about:blank", 6235 "href": "git+https://github.com/foo/bar", 6236 "origin": "null", 6237 "protocol": "git+https:", 6238 "username": "", 6239 "password": "", 6240 "host": "github.com", 6241 "hostname": "github.com", 6242 "port": "", 6243 "pathname": "/foo/bar", 6244 "search": "", 6245 "hash": "" 6246 }, 6247 { 6248 "input": "urn:ietf:rfc:2648", 6249 "base": "about:blank", 6250 "href": "urn:ietf:rfc:2648", 6251 "origin": "null", 6252 "protocol": "urn:", 6253 "username": "", 6254 "password": "", 6255 "host": "", 6256 "hostname": "", 6257 "port": "", 6258 "pathname": "ietf:rfc:2648", 6259 "search": "", 6260 "hash": "" 6261 }, 6262 { 6263 "input": "tag:joe@example.org,2001:foo/bar", 6264 "base": "about:blank", 6265 "href": "tag:joe@example.org,2001:foo/bar", 6266 "origin": "null", 6267 "protocol": "tag:", 6268 "username": "", 6269 "password": "", 6270 "host": "", 6271 "hostname": "", 6272 "port": "", 6273 "pathname": "joe@example.org,2001:foo/bar", 6274 "search": "", 6275 "hash": "" 6276 }, 6277 "# percent encoded hosts in non-special-URLs", 6278 { 6279 "input": "non-special://%E2%80%A0/", 6280 "base": "about:blank", 6281 "href": "non-special://%E2%80%A0/", 6282 "protocol": "non-special:", 6283 "username": "", 6284 "password": "", 6285 "host": "%E2%80%A0", 6286 "hostname": "%E2%80%A0", 6287 "port": "", 6288 "pathname": "/", 6289 "search": "", 6290 "hash": "" 6291 }, 6292 { 6293 "input": "non-special://H%4fSt/path", 6294 "base": "about:blank", 6295 "href": "non-special://H%4fSt/path", 6296 "protocol": "non-special:", 6297 "username": "", 6298 "password": "", 6299 "host": "H%4fSt", 6300 "hostname": "H%4fSt", 6301 "port": "", 6302 "pathname": "/path", 6303 "search": "", 6304 "hash": "" 6305 }, 6306 "# IPv6 in non-special-URLs", 6307 { 6308 "input": "non-special://[1:2:0:0:5:0:0:0]/", 6309 "base": "about:blank", 6310 "href": "non-special://[1:2:0:0:5::]/", 6311 "protocol": "non-special:", 6312 "username": "", 6313 "password": "", 6314 "host": "[1:2:0:0:5::]", 6315 "hostname": "[1:2:0:0:5::]", 6316 "port": "", 6317 "pathname": "/", 6318 "search": "", 6319 "hash": "" 6320 }, 6321 { 6322 "input": "non-special://[1:2:0:0:0:0:0:3]/", 6323 "base": "about:blank", 6324 "href": "non-special://[1:2::3]/", 6325 "protocol": "non-special:", 6326 "username": "", 6327 "password": "", 6328 "host": "[1:2::3]", 6329 "hostname": "[1:2::3]", 6330 "port": "", 6331 "pathname": "/", 6332 "search": "", 6333 "hash": "" 6334 }, 6335 { 6336 "input": "non-special://[1:2::3]:80/", 6337 "base": "about:blank", 6338 "href": "non-special://[1:2::3]:80/", 6339 "protocol": "non-special:", 6340 "username": "", 6341 "password": "", 6342 "host": "[1:2::3]:80", 6343 "hostname": "[1:2::3]", 6344 "port": "80", 6345 "pathname": "/", 6346 "search": "", 6347 "hash": "" 6348 }, 6349 { 6350 "input": "non-special://[:80/", 6351 "base": "about:blank", 6352 "failure": true 6353 }, 6354 { 6355 "input": "blob:https://example.com:443/", 6356 "base": "about:blank", 6357 "href": "blob:https://example.com:443/", 6358 "protocol": "blob:", 6359 "username": "", 6360 "password": "", 6361 "host": "", 6362 "hostname": "", 6363 "port": "", 6364 "pathname": "https://example.com:443/", 6365 "search": "", 6366 "hash": "" 6367 }, 6368 { 6369 "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", 6370 "base": "about:blank", 6371 "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf", 6372 "protocol": "blob:", 6373 "username": "", 6374 "password": "", 6375 "host": "", 6376 "hostname": "", 6377 "port": "", 6378 "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf", 6379 "search": "", 6380 "hash": "" 6381 }, 6382 "Invalid IPv4 radix digits", 6383 { 6384 "input": "http://0177.0.0.0189", 6385 "base": "about:blank", 6386 "href": "http://0177.0.0.0189/", 6387 "protocol": "http:", 6388 "username": "", 6389 "password": "", 6390 "host": "0177.0.0.0189", 6391 "hostname": "0177.0.0.0189", 6392 "port": "", 6393 "pathname": "/", 6394 "search": "", 6395 "hash": "" 6396 }, 6397 { 6398 "input": "http://0x7f.0.0.0x7g", 6399 "base": "about:blank", 6400 "href": "http://0x7f.0.0.0x7g/", 6401 "protocol": "http:", 6402 "username": "", 6403 "password": "", 6404 "host": "0x7f.0.0.0x7g", 6405 "hostname": "0x7f.0.0.0x7g", 6406 "port": "", 6407 "pathname": "/", 6408 "search": "", 6409 "hash": "" 6410 }, 6411 { 6412 "input": "http://0X7F.0.0.0X7G", 6413 "base": "about:blank", 6414 "href": "http://0x7f.0.0.0x7g/", 6415 "protocol": "http:", 6416 "username": "", 6417 "password": "", 6418 "host": "0x7f.0.0.0x7g", 6419 "hostname": "0x7f.0.0.0x7g", 6420 "port": "", 6421 "pathname": "/", 6422 "search": "", 6423 "hash": "" 6424 }, 6425 "Invalid IPv4 portion of IPv6 address", 6426 { 6427 "input": "http://[::127.0.0.0.1]", 6428 "base": "about:blank", 6429 "failure": true 6430 }, 6431 "Uncompressed IPv6 addresses with 0", 6432 { 6433 "input": "http://[0:1:0:1:0:1:0:1]", 6434 "base": "about:blank", 6435 "href": "http://[0:1:0:1:0:1:0:1]/", 6436 "protocol": "http:", 6437 "username": "", 6438 "password": "", 6439 "host": "[0:1:0:1:0:1:0:1]", 6440 "hostname": "[0:1:0:1:0:1:0:1]", 6441 "port": "", 6442 "pathname": "/", 6443 "search": "", 6444 "hash": "" 6445 }, 6446 { 6447 "input": "http://[1:0:1:0:1:0:1:0]", 6448 "base": "about:blank", 6449 "href": "http://[1:0:1:0:1:0:1:0]/", 6450 "protocol": "http:", 6451 "username": "", 6452 "password": "", 6453 "host": "[1:0:1:0:1:0:1:0]", 6454 "hostname": "[1:0:1:0:1:0:1:0]", 6455 "port": "", 6456 "pathname": "/", 6457 "search": "", 6458 "hash": "" 6459 }, 6460 "Percent-encoded query and fragment", 6461 { 6462 "input": "http://example.org/test?\u0022", 6463 "base": "about:blank", 6464 "href": "http://example.org/test?%22", 6465 "protocol": "http:", 6466 "username": "", 6467 "password": "", 6468 "host": "example.org", 6469 "hostname": "example.org", 6470 "port": "", 6471 "pathname": "/test", 6472 "search": "?%22", 6473 "hash": "" 6474 }, 6475 { 6476 "input": "http://example.org/test?\u0023", 6477 "base": "about:blank", 6478 "href": "http://example.org/test?#", 6479 "protocol": "http:", 6480 "username": "", 6481 "password": "", 6482 "host": "example.org", 6483 "hostname": "example.org", 6484 "port": "", 6485 "pathname": "/test", 6486 "search": "", 6487 "hash": "" 6488 }, 6489 { 6490 "input": "http://example.org/test?\u003C", 6491 "base": "about:blank", 6492 "href": "http://example.org/test?%3C", 6493 "protocol": "http:", 6494 "username": "", 6495 "password": "", 6496 "host": "example.org", 6497 "hostname": "example.org", 6498 "port": "", 6499 "pathname": "/test", 6500 "search": "?%3C", 6501 "hash": "" 6502 }, 6503 { 6504 "input": "http://example.org/test?\u003E", 6505 "base": "about:blank", 6506 "href": "http://example.org/test?%3E", 6507 "protocol": "http:", 6508 "username": "", 6509 "password": "", 6510 "host": "example.org", 6511 "hostname": "example.org", 6512 "port": "", 6513 "pathname": "/test", 6514 "search": "?%3E", 6515 "hash": "" 6516 }, 6517 { 6518 "input": "http://example.org/test?\u2323", 6519 "base": "about:blank", 6520 "href": "http://example.org/test?%E2%8C%A3", 6521 "protocol": "http:", 6522 "username": "", 6523 "password": "", 6524 "host": "example.org", 6525 "hostname": "example.org", 6526 "port": "", 6527 "pathname": "/test", 6528 "search": "?%E2%8C%A3", 6529 "hash": "" 6530 }, 6531 { 6532 "input": "http://example.org/test?%23%23", 6533 "base": "about:blank", 6534 "href": "http://example.org/test?%23%23", 6535 "protocol": "http:", 6536 "username": "", 6537 "password": "", 6538 "host": "example.org", 6539 "hostname": "example.org", 6540 "port": "", 6541 "pathname": "/test", 6542 "search": "?%23%23", 6543 "hash": "" 6544 }, 6545 { 6546 "input": "http://example.org/test?%GH", 6547 "base": "about:blank", 6548 "href": "http://example.org/test?%GH", 6549 "protocol": "http:", 6550 "username": "", 6551 "password": "", 6552 "host": "example.org", 6553 "hostname": "example.org", 6554 "port": "", 6555 "pathname": "/test", 6556 "search": "?%GH", 6557 "hash": "" 6558 }, 6559 { 6560 "input": "http://example.org/test?a#%EF", 6561 "base": "about:blank", 6562 "href": "http://example.org/test?a#%EF", 6563 "protocol": "http:", 6564 "username": "", 6565 "password": "", 6566 "host": "example.org", 6567 "hostname": "example.org", 6568 "port": "", 6569 "pathname": "/test", 6570 "search": "?a", 6571 "hash": "#%EF" 6572 }, 6573 { 6574 "input": "http://example.org/test?a#%GH", 6575 "base": "about:blank", 6576 "href": "http://example.org/test?a#%GH", 6577 "protocol": "http:", 6578 "username": "", 6579 "password": "", 6580 "host": "example.org", 6581 "hostname": "example.org", 6582 "port": "", 6583 "pathname": "/test", 6584 "search": "?a", 6585 "hash": "#%GH" 6586 }, 6587 "URLs that require a non-about:blank base. (Also serve as invalid base tests.)", 6588 { 6589 "input": "a", 6590 "base": "about:blank", 6591 "failure": true 6592 }, 6593 { 6594 "input": "a/", 6595 "base": "about:blank", 6596 "failure": true 6597 }, 6598 { 6599 "input": "a//", 6600 "base": "about:blank", 6601 "failure": true 6602 }, 6603 "Bases that don't fail to parse but fail to be bases", 6604 { 6605 "input": "test-a-colon.html", 6606 "base": "a:", 6607 "failure": true 6608 }, 6609 { 6610 "input": "test-a-colon-b.html", 6611 "base": "a:b", 6612 "failure": true 6613 }, 6614 "Other base URL tests, that must succeed", 6615 { 6616 "input": "test-a-colon-slash.html", 6617 "base": "a:/", 6618 "href": "a:/test-a-colon-slash.html", 6619 "protocol": "a:", 6620 "username": "", 6621 "password": "", 6622 "host": "", 6623 "hostname": "", 6624 "port": "", 6625 "pathname": "/test-a-colon-slash.html", 6626 "search": "", 6627 "hash": "" 6628 }, 6629 { 6630 "input": "test-a-colon-slash-slash.html", 6631 "base": "a://", 6632 "href": "a:///test-a-colon-slash-slash.html", 6633 "protocol": "a:", 6634 "username": "", 6635 "password": "", 6636 "host": "", 6637 "hostname": "", 6638 "port": "", 6639 "pathname": "/test-a-colon-slash-slash.html", 6640 "search": "", 6641 "hash": "" 6642 }, 6643 { 6644 "input": "test-a-colon-slash-b.html", 6645 "base": "a:/b", 6646 "href": "a:/test-a-colon-slash-b.html", 6647 "protocol": "a:", 6648 "username": "", 6649 "password": "", 6650 "host": "", 6651 "hostname": "", 6652 "port": "", 6653 "pathname": "/test-a-colon-slash-b.html", 6654 "search": "", 6655 "hash": "" 6656 }, 6657 { 6658 "input": "test-a-colon-slash-slash-b.html", 6659 "base": "a://b", 6660 "href": "a://b/test-a-colon-slash-slash-b.html", 6661 "protocol": "a:", 6662 "username": "", 6663 "password": "", 6664 "host": "b", 6665 "hostname": "b", 6666 "port": "", 6667 "pathname": "/test-a-colon-slash-slash-b.html", 6668 "search": "", 6669 "hash": "" 6670 }, 6671 "Null code point in fragment", 6672 { 6673 "input": "http://example.org/test?a#b\u0000c", 6674 "base": "about:blank", 6675 "href": "http://example.org/test?a#bc", 6676 "protocol": "http:", 6677 "username": "", 6678 "password": "", 6679 "host": "example.org", 6680 "hostname": "example.org", 6681 "port": "", 6682 "pathname": "/test", 6683 "search": "?a", 6684 "hash": "#bc" 6685 } 6686] 6687