Source code

Revision control

Copy as Markdown

Other Tools

[
"This file is based on testing/web-platform/tests/url/resources/urltestdata.json (with failing tests removed)",
{
"href": "http://example.org/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"origin": "http://foo:21",
"protocol": "http:",
"username": "user",
"password": "pass",
"host": "foo:21",
"hostname": "foo",
"port": "21",
"pathname": "/bar;par",
"search": "?b",
"hash": "#c"
},
{
"input": "https://test:@test",
"base": null,
"href": "https://test@test/",
"origin": "https://test",
"protocol": "https:",
"username": "test",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https://:@test",
"base": null,
"href": "https://test/",
"origin": "https://test",
"protocol": "https:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "non-special:",
"username": "test",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/x",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "non-special:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/x",
"search": "",
"hash": ""
},
{
"input": "http:foo.com",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/foo.com",
"search": "",
"hash": ""
},
{
"input": "\t :foo.com \n",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:foo.com",
"search": "",
"hash": ""
},
{
"input": " foo.com ",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/foo.com",
"search": "",
"hash": ""
},
{
"input": "a:\t foo.com",
"href": "a: foo.com",
"origin": "null",
"protocol": "a:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": " foo.com",
"search": "",
"hash": ""
},
{
"input": "http://f:21/ b ? d # e ",
"origin": "http://f:21",
"protocol": "http:",
"username": "",
"password": "",
"host": "f:21",
"hostname": "f",
"port": "21",
"pathname": "/%20b%20",
"search": "?%20d%20",
"hash": "#%20e"
},
{
"input": "lolscheme:x x#x x",
"base": null,
"href": "lolscheme:x x#x%20x",
"protocol": "lolscheme:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "x x",
"search": "",
"hash": "#x%20x"
},
{
"input": "http://f:/c",
"href": "http://f/c",
"origin": "http://f",
"protocol": "http:",
"username": "",
"password": "",
"host": "f",
"hostname": "f",
"port": "",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"input": "http://f:0/c",
"href": "http://f:0/c",
"origin": "http://f:0",
"protocol": "http:",
"username": "",
"password": "",
"host": "f:0",
"hostname": "f",
"port": "0",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"href": "http://f:0/c",
"origin": "http://f:0",
"protocol": "http:",
"username": "",
"password": "",
"host": "f:0",
"hostname": "f",
"port": "0",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"href": "http://f/c",
"origin": "http://f",
"protocol": "http:",
"username": "",
"password": "",
"host": "f",
"hostname": "f",
"port": "",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"input": "http://f:b/c",
"failure": true
},
{
"input": "http://f: /c",
"failure": true
},
{
"input": "http://f:\n/c",
"href": "http://f/c",
"origin": "http://f",
"protocol": "http:",
"username": "",
"password": "",
"host": "f",
"hostname": "f",
"port": "",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"input": "http://f:fifty-two/c",
"failure": true
},
{
"input": "http://f:999999/c",
"failure": true
},
{
"failure": true
},
{
"input": "http://f: 21 / b ? d # e ",
"failure": true
},
{
"input": "",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": " \t",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": ":foo.com/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:foo.com/",
"search": "",
"hash": ""
},
{
"input": ":foo.com\\",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:foo.com/",
"search": "",
"hash": ""
},
{
"input": ":",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:",
"search": "",
"hash": ""
},
{
"input": ":a",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:a",
"search": "",
"hash": ""
},
{
"input": ":/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:/",
"search": "",
"hash": ""
},
{
"input": ":\\",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:/",
"search": "",
"hash": ""
},
{
"input": ":#",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:",
"search": "",
"hash": ""
},
{
"input": "#",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": "#/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#/"
},
{
"input": "#\\",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#\\"
},
{
"input": "#;?",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#;?"
},
{
"input": "?",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/",
"href": "http://example.org/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": ":23",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:23",
"search": "",
"hash": ""
},
{
"input": "/:23",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/:23",
"search": "",
"hash": ""
},
{
"input": "\\x",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/x",
"search": "",
"hash": ""
},
{
"input": "\\\\x\\hello",
"href": "http://x/hello",
"origin": "http://x",
"protocol": "http:",
"username": "",
"password": "",
"host": "x",
"hostname": "x",
"port": "",
"pathname": "/hello",
"search": "",
"hash": ""
},
{
"input": "::",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/::",
"search": "",
"hash": ""
},
{
"input": "::23",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/::23",
"search": "",
"hash": ""
},
{
"input": "foo://",
"href": "foo://",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "http://a:b@c:29/d",
"href": "http://a:b@c:29/d",
"origin": "http://c:29",
"protocol": "http:",
"username": "a",
"password": "b",
"host": "c:29",
"hostname": "c",
"port": "29",
"pathname": "/d",
"search": "",
"hash": ""
},
{
"input": "http::@c:29",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:@c:29",
"search": "",
"hash": ""
},
{
"input": "http://&a:foo(b]c@d:2/",
"origin": "http://d:2",
"protocol": "http:",
"username": "&a",
"password": "foo(b%5Dc",
"host": "d:2",
"hostname": "d",
"port": "2",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://::@c@d:2",
"origin": "http://d:2",
"protocol": "http:",
"username": "",
"password": "%3A%40c",
"host": "d:2",
"hostname": "d",
"port": "2",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://foo.com:b@d/",
"href": "http://foo.com:b@d/",
"origin": "http://d",
"protocol": "http:",
"username": "foo.com",
"password": "b",
"host": "d",
"hostname": "d",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://foo.com/\\@",
"href": "http://foo.com//@",
"origin": "http://foo.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.com",
"hostname": "foo.com",
"port": "",
"pathname": "//@",
"search": "",
"hash": ""
},
{
"input": "http:\\\\foo.com\\",
"href": "http://foo.com/",
"origin": "http://foo.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.com",
"hostname": "foo.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:\\\\a\\b:c\\d@foo.com\\",
"origin": "http://a",
"protocol": "http:",
"username": "",
"password": "",
"host": "a",
"hostname": "a",
"port": "",
"pathname": "/b:c/d@foo.com/",
"search": "",
"hash": ""
},
{
"input": "foo:/",
"href": "foo:/",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "foo:/bar.com/",
"href": "foo:/bar.com/",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/bar.com/",
"search": "",
"hash": ""
},
{
"input": "foo://///////",
"href": "foo://///////",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///////",
"search": "",
"hash": ""
},
{
"input": "foo://///////bar.com/",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///////bar.com/",
"search": "",
"hash": ""
},
{
"input": "foo:////://///",
"href": "foo:////://///",
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//://///",
"search": "",
"hash": ""
},
{
"input": "c:/foo",
"href": "c:/foo",
"origin": "null",
"protocol": "c:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"input": "//foo/bar",
"href": "http://foo/bar",
"origin": "http://foo",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/bar",
"search": "",
"hash": ""
},
{
"origin": "http://foo",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/path;a",
"search": "??e",
"hash": "#f#g"
},
{
"origin": "http://foo",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/abcd",
"search": "?efgh?ijkl",
"hash": ""
},
{
"origin": "http://foo",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/abcd",
"search": "",
"hash": "#foo?bar"
},
{
"input": "[61:24:74]:98",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/[61:24:74]:98",
"search": "",
"hash": ""
},
{
"input": "http:[61:27]/:foo",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/[61:27]/:foo",
"search": "",
"hash": ""
},
{
"input": "http://[1::2]:3:4",
"failure": true
},
{
"input": "http://2001::1",
"failure": true
},
{
"input": "http://2001::1]",
"failure": true
},
{
"input": "http://2001::1]:80",
"failure": true
},
{
"input": "http://[2001::1]",
"href": "http://[2001::1]/",
"origin": "http://[2001::1]",
"protocol": "http:",
"username": "",
"password": "",
"host": "[2001::1]",
"hostname": "[2001::1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://[::127.0.0.1]",
"href": "http://[::7f00:1]/",
"origin": "http://[::7f00:1]",
"protocol": "http:",
"username": "",
"password": "",
"host": "[::7f00:1]",
"hostname": "[::7f00:1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://[::127.0.0.1.]",
"failure": true
},
{
"origin": "http://[::d01:4403]",
"protocol": "http:",
"username": "",
"password": "",
"host": "[::d01:4403]",
"hostname": "[::d01:4403]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://[2001::1]:80",
"href": "http://[2001::1]/",
"origin": "http://[2001::1]",
"protocol": "http:",
"username": "",
"password": "",
"host": "[2001::1]",
"hostname": "[2001::1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/example.com/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "ftp:/example.com/",
"href": "ftp://example.com/",
"origin": "ftp://example.com",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https:/example.com/",
"origin": "https://example.com",
"protocol": "https:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "madeupscheme:/example.com/",
"href": "madeupscheme:/example.com/",
"origin": "null",
"protocol": "madeupscheme:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "file:/example.com/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "file://example:1/",
"base": null,
"failure": true
},
{
"input": "file://example:test/",
"base": null,
"failure": true
},
{
"input": "file://example%/",
"base": null,
"failure": true
},
{
"input": "file://[example]/",
"base": null,
"failure": true
},
{
"input": "ftps:/example.com/",
"href": "ftps:/example.com/",
"origin": "null",
"protocol": "ftps:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "gopher:/example.com/",
"href": "gopher:/example.com/",
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "ws:/example.com/",
"href": "ws://example.com/",
"origin": "ws://example.com",
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss:/example.com/",
"href": "wss://example.com/",
"origin": "wss://example.com",
"protocol": "wss:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "data:/example.com/",
"href": "data:/example.com/",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "javascript:/example.com/",
"href": "javascript:/example.com/",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "mailto:/example.com/",
"href": "mailto:/example.com/",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "http:example.com/",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/example.com/",
"search": "",
"hash": ""
},
{
"input": "ftp:example.com/",
"href": "ftp://example.com/",
"origin": "ftp://example.com",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https:example.com/",
"origin": "https://example.com",
"protocol": "https:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "madeupscheme:example.com/",
"href": "madeupscheme:example.com/",
"origin": "null",
"protocol": "madeupscheme:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "ftps:example.com/",
"href": "ftps:example.com/",
"origin": "null",
"protocol": "ftps:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "gopher:example.com/",
"href": "gopher:example.com/",
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "ws:example.com/",
"href": "ws://example.com/",
"origin": "ws://example.com",
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss:example.com/",
"href": "wss://example.com/",
"origin": "wss://example.com",
"protocol": "wss:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "data:example.com/",
"href": "data:example.com/",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "javascript:example.com/",
"href": "javascript:example.com/",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "mailto:example.com/",
"href": "mailto:example.com/",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "/a/b/c",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a/b/c",
"search": "",
"hash": ""
},
{
"input": "/a/ /c",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a/%20/c",
"search": "",
"hash": ""
},
{
"input": "/a%2fc",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a%2fc",
"search": "",
"hash": ""
},
{
"input": "/a/%2f/c",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a/%2f/c",
"search": "",
"hash": ""
},
{
"input": "#β",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#%CE%B2"
},
{
"input": "data:text/html,test#test",
"href": "data:text/html,test#test",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "text/html,test",
"search": "",
"hash": "#test"
},
{
"input": "tel:1234567890",
"href": "tel:1234567890",
"origin": "null",
"protocol": "tel:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "1234567890",
"search": "",
"hash": ""
},
{
"input": "file:c:\\foo\\bar.html",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar.html",
"search": "",
"hash": ""
},
{
"input": " File:c|////foo\\bar.html",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:////foo/bar.html",
"search": "",
"hash": ""
},
{
"input": "C|/foo/bar",
"href": "file:///C:/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/C|\\foo\\bar",
"href": "file:///C:/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "//C|/foo/bar",
"href": "file:///C:/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "//server/file",
"href": "file://server/file",
"protocol": "file:",
"username": "",
"password": "",
"host": "server",
"hostname": "server",
"port": "",
"pathname": "/file",
"search": "",
"hash": ""
},
{
"input": "\\\\server\\file",
"href": "file://server/file",
"protocol": "file:",
"username": "",
"password": "",
"host": "server",
"hostname": "server",
"port": "",
"pathname": "/file",
"search": "",
"hash": ""
},
{
"input": "/\\server/file",
"href": "file://server/file",
"protocol": "file:",
"username": "",
"password": "",
"host": "server",
"hostname": "server",
"port": "",
"pathname": "/file",
"search": "",
"hash": ""
},
{
"input": "file:///foo/bar.txt",
"href": "file:///foo/bar.txt",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/foo/bar.txt",
"search": "",
"hash": ""
},
{
"input": "file:///home/me",
"href": "file:///home/me",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/home/me",
"search": "",
"hash": ""
},
{
"input": "//",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "///",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "///test",
"href": "file:///test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "file://test",
"href": "file://test/",
"protocol": "file:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file://localhost",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file://localhost/",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file://localhost/test",
"href": "file:///test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/tmp/mock/test",
"search": "",
"hash": ""
},
{
"input": "file:test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/tmp/mock/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/.foo",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"input": "http://example.com/foo/./",
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/..bar",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/ton",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"input": "http://example.com/foo/../../..",
"base": null,
"href": "http://example.com/",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/ton",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/%2e%2",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%2e.bar",
"search": "",
"hash": ""
},
{
"input": "http://example.com////../..",
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "http://example.com/foo/bar//../..",
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/bar/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%20foo",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%2",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%2zbar",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%2%C3%82%C2%A9zbar",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%41%7a",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%C2%91%91",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%00%51",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/(%28:%3A%29)",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%3A%3a%3C%3c",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foobar",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "//foo//bar",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/@asdf%40",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%E2%80%A5/foo",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%EF%BB%BF/foo",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://www.google.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/foo",
"search": "?bar=baz",
"hash": ""
},
{
"base": null,
"origin": "http://www.google.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/foo",
"search": "?bar=baz",
"hash": "#%20%C2%BB"
},
{
"input": "data:test# »",
"base": null,
"href": "data:test#%20%C2%BB",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "test",
"search": "",
"hash": "#%20%C2%BB"
},
{
"input": "http://www.google.com",
"base": null,
"origin": "http://www.google.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://192.0x00A80001",
"base": null,
"href": "http://192.168.0.1/",
"origin": "http://192.168.0.1",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://www/foo%2Ehtml",
"base": null,
"origin": "http://www",
"protocol": "http:",
"username": "",
"password": "",
"host": "www",
"hostname": "www",
"port": "",
"pathname": "/foo%2Ehtml",
"search": "",
"hash": ""
},
{
"base": null,
"href": "http://www/foo/html",
"origin": "http://www",
"protocol": "http:",
"username": "",
"password": "",
"host": "www",
"hostname": "www",
"port": "",
"pathname": "/foo/html",
"search": "",
"hash": ""
},
{
"input": "http://user:pass@/",
"base": null,
"failure": true
},
{
"base": null,
"origin": "http://foodomain.com",
"protocol": "http:",
"username": "%25DOMAIN",
"password": "foobar",
"host": "foodomain.com",
"hostname": "foodomain.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:\\\\www.google.com\\foo",
"base": null,
"origin": "http://www.google.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"input": "http://foo:80/",
"base": null,
"href": "http://foo/",
"origin": "http://foo",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://foo:81/",
"base": null,
"href": "http://foo:81/",
"origin": "http://foo:81",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo:81",
"hostname": "foo",
"port": "81",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "httpa://foo:80/",
"base": null,
"href": "httpa://foo:80/",
"origin": "null",
"protocol": "httpa:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://foo:-80/",
"base": null,
"failure": true
},
{
"input": "https://foo:443/",
"base": null,
"href": "https://foo/",
"origin": "https://foo",
"protocol": "https:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https://foo:80/",
"base": null,
"href": "https://foo:80/",
"origin": "https://foo:80",
"protocol": "https:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ftp://foo:21/",
"base": null,
"href": "ftp://foo/",
"origin": "ftp://foo",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ftp://foo:80/",
"base": null,
"href": "ftp://foo:80/",
"origin": "ftp://foo:80",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "gopher://foo:70/",
"base": null,
"href": "gopher://foo:70/",
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "foo:70",
"hostname": "foo",
"port": "70",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "gopher://foo:443/",
"base": null,
"href": "gopher://foo:443/",
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "foo:443",
"hostname": "foo",
"port": "443",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ws://foo:80/",
"base": null,
"href": "ws://foo/",
"origin": "ws://foo",
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ws://foo:81/",
"base": null,
"href": "ws://foo:81/",
"origin": "ws://foo:81",
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo:81",
"hostname": "foo",
"port": "81",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ws://foo:443/",
"base": null,
"href": "ws://foo:443/",
"origin": "ws://foo:443",
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo:443",
"hostname": "foo",
"port": "443",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ws://foo:815/",
"base": null,
"href": "ws://foo:815/",
"origin": "ws://foo:815",
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo:815",
"hostname": "foo",
"port": "815",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss://foo:80/",
"base": null,
"href": "wss://foo:80/",
"origin": "wss://foo:80",
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss://foo:81/",
"base": null,
"href": "wss://foo:81/",
"origin": "wss://foo:81",
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo:81",
"hostname": "foo",
"port": "81",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss://foo:443/",
"base": null,
"href": "wss://foo/",
"origin": "wss://foo",
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss://foo:815/",
"base": null,
"href": "wss://foo:815/",
"origin": "wss://foo:815",
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo:815",
"hostname": "foo",
"port": "815",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ftp:/example.com/",
"base": null,
"href": "ftp://example.com/",
"origin": "ftp://example.com",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https:/example.com/",
"base": null,
"origin": "https://example.com",
"protocol": "https:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "madeupscheme:/example.com/",
"base": null,
"href": "madeupscheme:/example.com/",
"origin": "null",
"protocol": "madeupscheme:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "file:/example.com/",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "ftps:/example.com/",
"base": null,
"href": "ftps:/example.com/",
"origin": "null",
"protocol": "ftps:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "gopher:/example.com/",
"base": null,
"href": "gopher:/example.com/",
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "ws:/example.com/",
"base": null,
"href": "ws://example.com/",
"origin": "ws://example.com",
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss:/example.com/",
"base": null,
"href": "wss://example.com/",
"origin": "wss://example.com",
"protocol": "wss:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "data:/example.com/",
"base": null,
"href": "data:/example.com/",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "javascript:/example.com/",
"base": null,
"href": "javascript:/example.com/",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "mailto:/example.com/",
"base": null,
"href": "mailto:/example.com/",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "ftp:example.com/",
"base": null,
"href": "ftp://example.com/",
"origin": "ftp://example.com",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https:example.com/",
"base": null,
"origin": "https://example.com",
"protocol": "https:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "madeupscheme:example.com/",
"base": null,
"href": "madeupscheme:example.com/",
"origin": "null",
"protocol": "madeupscheme:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "ftps:example.com/",
"base": null,
"href": "ftps:example.com/",
"origin": "null",
"protocol": "ftps:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "gopher:example.com/",
"base": null,
"href": "gopher:example.com/",
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "ws:example.com/",
"base": null,
"href": "ws://example.com/",
"origin": "ws://example.com",
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss:example.com/",
"base": null,
"href": "wss://example.com/",
"origin": "wss://example.com",
"protocol": "wss:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "data:example.com/",
"base": null,
"href": "data:example.com/",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "javascript:example.com/",
"base": null,
"href": "javascript:example.com/",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"input": "mailto:example.com/",
"base": null,
"href": "mailto:example.com/",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "example.com/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://www.example.com",
"protocol": "http:",
"username": "a",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://@pple.com",
"base": null,
"href": "http://pple.com/",
"origin": "http://pple.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "pple.com",
"hostname": "pple.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/:@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"failure": true
},
{
"input": "http:@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"input": "http:/@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"failure": true
},
{
"input": "https:@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"input": "http:a:b@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"input": "http:/a:b@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"failure": true
},
{
"input": "http::@/www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"origin": "http://www.example.com",
"protocol": "http:",
"username": "a",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://www.@pple.com",
"base": null,
"origin": "http://pple.com",
"protocol": "http:",
"username": "www.",
"password": "",
"host": "pple.com",
"hostname": "pple.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:@:www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"input": "http:/@:www.example.com",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"failure": true
},
{
"base": null,
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# Others",
{
"input": "/",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "/test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": ".",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "..",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "./test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "../test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "../aaa/test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/aaa/test.txt",
"search": "",
"hash": ""
},
{
"input": "../../test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "中/test.txt",
"origin": "http://www.example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/%E4%B8%AD/test.txt",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example2.com",
"hostname": "www.example2.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "//www.example2.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example2.com",
"hostname": "www.example2.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:...",
"href": "file:///...",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/...",
"search": "",
"hash": ""
},
{
"input": "file:..",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:a",
"href": "file:///a",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/a",
"search": "",
"hash": ""
},
"Basic canonicalization, uppercase should be converted to lowercase",
{
"input": "http://ExAmPlE.CoM",
"base": "http://other.com/",
"href": "http://example.com/",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://example example.com",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://Goo%20 goo%7C|.com",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[:]",
"base": "http://other.com/",
"failure": true
},
"U+3000 is mapped to U+0020 (space) which is disallowed",
{
"base": "http://other.com/",
"failure": true
},
"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",
{
"base": "http://other.com/",
"href": "http://googoo.com/",
"origin": "http://googoo.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "googoo.com",
"hostname": "googoo.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Leading and trailing C0 control or space",
{
"input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
"base": null,
"href": "http://example.com/",
"origin": "http://example.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
{
"base": "http://other.com/",
"origin": "http://www.foo.bar.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.foo.bar.com",
"hostname": "www.foo.bar.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
{
"input": "http://\ufdd0zyx.com",
"base": "http://other.com/",
"failure": true
},
"This is the same as previous but escaped",
{
"base": "http://other.com/",
"failure": true
},
"U+FFFD",
{
"input": "https://\ufffd",
"base": null,
"failure": true
},
{
"input": "https://%EF%BF%BD",
"base": null,
"failure": true
},
{
"base": null,
"origin": "https://x",
"protocol": "https:",
"username": "",
"password": "",
"host": "x",
"hostname": "x",
"port": "",
"pathname": "/%EF%BF%BD",
"search": "?%EF%BF%BD",
"hash": "#%EF%BF%BD"
},
"Domain is ASCII, but a label is invalid IDNA",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"IDNA labels should be matched case-insensitively",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
{
"input": "http://Go.com",
"base": "http://other.com/",
"href": "http://go.com/",
"origin": "http://go.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "go.com",
"hostname": "go.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
{
"input": "http://%41.com",
"base": "http://other.com/",
"failure": true
},
{
"base": "http://other.com/",
"failure": true
},
"...%00 in fullwidth should fail (also as escaped UTF-8 input)",
{
"input": "http://%00.com",
"base": "http://other.com/",
"failure": true
},
{
"base": "http://other.com/",
"failure": true
},
"Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
{
"input": "http://你好你好",
"base": "http://other.com/",
"origin": "http://xn--6qqa088eba",
"protocol": "http:",
"username": "",
"password": "",
"host": "xn--6qqa088eba",
"hostname": "xn--6qqa088eba",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https://faß.ExAmPlE/",
"base": null,
"protocol": "https:",
"username": "",
"password": "",
"host": "xn--fa-hia.example",
"hostname": "xn--fa-hia.example",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "sc://faß.ExAmPlE/",
"base": null,
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "fa%C3%9F.ExAmPlE",
"hostname": "fa%C3%9F.ExAmPlE",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
{
"input": "http://%zz%66%a.com",
"base": "http://other.com/",
"failure": true
},
"If we get an invalid character that has been escaped.",
{
"input": "http://%25",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://hello%00",
"base": "http://other.com/",
"failure": true
},
"Escaped numbers should be treated like IP addresses if they are.",
{
"base": "http://other.com/",
"href": "http://192.168.0.1/",
"origin": "http://192.168.0.1",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": "http://other.com/",
"href": "http://192.168.0.1/",
"origin": "http://192.168.0.1",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://192.168.0.257",
"base": "http://other.com/",
"failure": true
},
"Invalid escaping in hosts causes failure",
{
"base": "http://other.com/",
"failure": true
},
"A space in a host causes failure",
{
"input": "http://192.168.0.1 hello",
"base": "http://other.com/",
"failure": true
},
{
"input": "https://x x:12",
"base": null,
"failure": true
},
"Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
{
"base": "http://other.com/",
"href": "http://192.168.0.1/",
"origin": "http://192.168.0.1",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Domains with empty labels",
{
"input": "http://./",
"base": null,
"href": "http://./",
"origin": "http://.",
"protocol": "http:",
"username": "",
"password": "",
"host": ".",
"hostname": ".",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://../",
"base": null,
"href": "http://../",
"origin": "http://..",
"protocol": "http:",
"username": "",
"password": "",
"host": "..",
"hostname": "..",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Non-special domains with empty labels",
{
"input": "h://.",
"base": null,
"href": "h://.",
"origin": "null",
"protocol": "h:",
"username": "",
"password": "",
"host": ".",
"hostname": ".",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
"Broken IPv6",
{
"base": null,
"failure": true
},
{
"input": "http://[google.com]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.2.3.4x]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.2.3.]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.2.]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::.1.2]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::1.]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::.1]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://[::%31]",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://%5B::1]",
"base": "http://other.com/",
"failure": true
},
"Misc Unicode",
{
"base": "http://other.com/",
"origin": "http://example.com",
"protocol": "http:",
"username": "foo",
"password": "%F0%9F%92%A9",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/bar",
"search": "",
"hash": ""
},
"# resolving a fragment against any scheme succeeds",
{
"input": "#",
"base": "test:test",
"href": "test:test#",
"origin": "null",
"protocol": "test:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "test",
"search": "",
"hash": ""
},
{
"input": "#x",
"base": "mailto:x@x.com",
"href": "mailto:x@x.com#x",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "x@x.com",
"search": "",
"hash": "#x"
},
{
"input": "#x",
"base": "data:,",
"href": "data:,#x",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": ",",
"search": "",
"hash": "#x"
},
{
"input": "#x",
"base": "about:blank",
"href": "about:blank#x",
"origin": "null",
"protocol": "about:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "blank",
"search": "",
"hash": "#x"
},
{
"input": "#x:y",
"base": "about:blank",
"href": "about:blank#x:y",
"origin": "null",
"protocol": "about:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "blank",
"search": "",
"hash": "#x:y"
},
{
"input": "#",
"base": "test:test?test",
"href": "test:test?test#",
"origin": "null",
"protocol": "test:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "test",
"search": "?test",
"hash": ""
},
"# multiple @ in authority state",
{
"origin": "https://example:800",
"protocol": "https:",
"username": "%40test%40test",
"password": "",
"host": "example:800",
"hostname": "example",
"port": "800",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https://@@@example",
"origin": "https://example",
"protocol": "https:",
"username": "%40%40",
"password": "",
"host": "example",
"hostname": "example",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"non-az-09 characters",
{
"origin": "http://h",
"protocol": "http:",
"username": "%60%7B%7D",
"password": "%60%7B%7D",
"host": "h",
"hostname": "h",
"port": "",
"pathname": "/%60%7B%7D",
"search": "?`{}",
"hash": ""
},
"byte is ' and url is special",
{
"input": "http://host/?'",
"base": null,
"href": "http://host/?%27",
"origin": "http://host",
"protocol": "http:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/",
"search": "?%27",
"hash": ""
},
{
"input": "notspecial://host/?'",
"base": null,
"href": "notspecial://host/?'",
"origin": "null",
"protocol": "notspecial:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/",
"search": "?'",
"hash": ""
},
"# Credentials in base",
{
"input": "/some/path",
"origin": "http://example.org",
"protocol": "http:",
"username": "user",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/some/path",
"search": "",
"hash": ""
},
{
"input": "",
"origin": "http://example.org:21",
"protocol": "http:",
"username": "user",
"password": "pass",
"host": "example.org:21",
"hostname": "example.org",
"port": "21",
"pathname": "/smth",
"search": "",
"hash": ""
},
{
"input": "/some/path",
"origin": "http://example.org:21",
"protocol": "http:",
"username": "user",
"password": "pass",
"host": "example.org:21",
"hostname": "example.org",
"port": "21",
"pathname": "/some/path",
"search": "",
"hash": ""
},
"# a set of tests designed by zcorpan for relative URLs with unknown schemes",
{
"input": "i",
"base": "sc:sd",
"failure": true
},
{
"input": "i",
"base": "sc:sd/sd",
"failure": true
},
{
"input": "i",
"base": "sc:/pa/pa",
"href": "sc:/pa/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pa/i",
"search": "",
"hash": ""
},
{
"input": "i",
"base": "sc://ho/pa",
"href": "sc://ho/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "i",
"base": "sc:///pa/pa",
"href": "sc:///pa/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pa/i",
"search": "",
"hash": ""
},
{
"input": "../i",
"base": "sc:sd",
"failure": true
},
{
"input": "../i",
"base": "sc:sd/sd",
"failure": true
},
{
"input": "../i",
"base": "sc:/pa/pa",
"href": "sc:/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "../i",
"base": "sc://ho/pa",
"href": "sc://ho/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "../i",
"base": "sc:///pa/pa",
"href": "sc:///i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "/i",
"base": "sc:sd",
"failure": true
},
{
"input": "/i",
"base": "sc:sd/sd",
"failure": true
},
{
"input": "/i",
"base": "sc:/pa/pa",
"href": "sc:/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "/i",
"base": "sc://ho/pa",
"href": "sc://ho/i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "/i",
"base": "sc:///pa/pa",
"href": "sc:///i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "?i",
"base": "sc:sd",
"failure": true
},
{
"input": "?i",
"base": "sc:sd/sd",
"failure": true
},
{
"input": "?i",
"base": "sc:/pa/pa",
"href": "sc:/pa/pa?i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pa/pa",
"search": "?i",
"hash": ""
},
{
"input": "?i",
"base": "sc://ho/pa",
"href": "sc://ho/pa?i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/pa",
"search": "?i",
"hash": ""
},
{
"input": "?i",
"base": "sc:///pa/pa",
"href": "sc:///pa/pa?i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pa/pa",
"search": "?i",
"hash": ""
},
{
"input": "#i",
"base": "sc:sd",
"href": "sc:sd#i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "sd",
"search": "",
"hash": "#i"
},
{
"input": "#i",
"base": "sc:sd/sd",
"href": "sc:sd/sd#i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "sd/sd",
"search": "",
"hash": "#i"
},
{
"input": "#i",
"base": "sc:/pa/pa",
"href": "sc:/pa/pa#i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pa/pa",
"search": "",
"hash": "#i"
},
{
"input": "#i",
"base": "sc://ho/pa",
"href": "sc://ho/pa#i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/pa",
"search": "",
"hash": "#i"
},
{
"input": "#i",
"base": "sc:///pa/pa",
"href": "sc:///pa/pa#i",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pa/pa",
"search": "",
"hash": "#i"
},
"# make sure that relative URL logic works on known typically non-relative schemes too",
{
"input": "data:/../",
"base": null,
"href": "data:/",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "javascript:/../",
"base": null,
"href": "javascript:/",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "mailto:/../",
"base": null,
"href": "mailto:/",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# unknown schemes and their hosts",
{
"input": "sc://ñ.test/",
"base": null,
"href": "sc://%C3%B1.test/",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1.test",
"hostname": "%C3%B1.test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "sc://%/",
"base": null,
"href": "sc://%/",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%",
"hostname": "%",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "sc://@/",
"base": null,
"failure": true
},
{
"input": "sc://te@s:t@/",
"base": null,
"failure": true
},
{
"input": "sc://:/",
"base": null,
"failure": true
},
{
"input": "sc://:12/",
"base": null,
"failure": true
},
{
"input": "x",
"base": "sc://ñ",
"href": "sc://%C3%B1/x",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "/x",
"search": "",
"hash": ""
},
"# unknown schemes and backslashes",
{
"input": "sc:\\../",
"base": null,
"href": "sc:\\../",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "\\../",
"search": "",
"hash": ""
},
"# unknown scheme with path looking like a password",
{
"input": "sc::a@example.net",
"base": null,
"href": "sc::a@example.net",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": ":a@example.net",
"search": "",
"hash": ""
},
"# unknown scheme with bogus percent-encoding",
{
"input": "wow:%NBD",
"base": null,
"href": "wow:%NBD",
"origin": "null",
"protocol": "wow:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "%NBD",
"search": "",
"hash": ""
},
{
"input": "wow:%1G",
"base": null,
"href": "wow:%1G",
"origin": "null",
"protocol": "wow:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "%1G",
"search": "",
"hash": ""
},
"# unknown scheme with non-URL characters",
{
"input": "wow:\uFFFF",
"base": null,
"href": "wow:%EF%BF%BF",
"origin": "null",
"protocol": "wow:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "%EF%BF%BF",
"search": "",
"hash": ""
},
"Forbidden host code points",
{
"input": "sc://a\u0000b/",
"base": null,
"failure": true
},
{
"input": "sc://a b/",
"base": null,
"failure": true
},
{
"input": "sc://a<b",
"base": null,
"failure": true
},
{
"input": "sc://a>b",
"base": null,
"failure": true
},
{
"input": "sc://a[b/",
"base": null,
"failure": true
},
{
"input": "sc://a\\b/",
"base": null,
"failure": true
},
{
"input": "sc://a]b/",
"base": null,
"failure": true
},
{
"input": "sc://a^b",
"base": null,
"failure": true
},
{
"input": "sc://a|b/",
"base": null,
"failure": true
},
"Forbidden host codepoints: tabs and newlines are removed during preprocessing",
{
"input": "foo://ho\u0009st/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://host/",
"password": "",
"pathname": "/",
"port": "",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "foo://ho\u000Ast/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://host/",
"password": "",
"pathname": "/",
"port": "",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "foo://ho\u000Dst/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"href": "foo://host/",
"password": "",
"pathname": "/",
"port": "",
"protocol": "foo:",
"search": "",
"username": ""
},
"Forbidden domain code-points",
{
"input": "http://a\u0000b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0001b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0002b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0003b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0004b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0005b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0006b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0007b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0008b/",
"base": null,
"failure": true
},
{
"input": "http://a\u000Bb/",
"base": null,
"failure": true
},
{
"input": "http://a\u000Cb/",
"base": null,
"failure": true
},
{
"input": "http://a\u000Eb/",
"base": null,
"failure": true
},
{
"input": "http://a\u000Fb/",
"base": null,
"failure": true
},
{
"input": "http://a\u0010b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0011b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0012b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0013b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0014b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0015b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0016b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0017b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0018b/",
"base": null,
"failure": true
},
{
"input": "http://a\u0019b/",
"base": null,
"failure": true
},
{
"input": "http://a\u001Ab/",
"base": null,
"failure": true
},
{
"input": "http://a\u001Bb/",
"base": null,
"failure": true
},
{
"input": "http://a\u001Cb/",
"base": null,
"failure": true
},
{
"input": "http://a\u001Db/",
"base": null,
"failure": true
},
{
"input": "http://a\u001Eb/",
"base": null,
"failure": true
},
{
"input": "http://a\u001Fb/",
"base": null,
"failure": true
},
{
"input": "http://a b/",
"base": null,
"failure": true
},
{
"input": "http://a%b/",
"base": null,
"failure": true
},
{
"input": "http://a<b",
"base": null,
"failure": true
},
{
"input": "http://a>b",
"base": null,
"failure": true
},
{
"input": "http://a[b/",
"base": null,
"failure": true
},
{
"input": "http://a]b/",
"base": null,
"failure": true
},
{
"input": "http://a^b",
"base": null,
"failure": true
},
{
"input": "http://a|b/",
"base": null,
"failure": true
},
{
"input": "http://a\u007Fb/",
"base": null,
"failure": true
},
"Forbidden domain codepoints: tabs and newlines are removed during preprocessing",
{
"input": "http://ho\u0009st/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"href": "http://host/",
"password": "",
"pathname": "/",
"port": "",
"protocol": "http:",
"search": "",
"username": ""
},
{
"input": "http://ho\u000Ast/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"href": "http://host/",
"password": "",
"pathname": "/",
"port": "",
"protocol": "http:",
"search": "",
"username": ""
},
{
"input": "http://ho\u000Dst/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"href": "http://host/",
"password": "",
"pathname": "/",
"port": "",
"protocol": "http:",
"search": "",
"username": ""
},
"Encoded forbidden domain codepoints in special URLs",
{
"input": "http://ho%00st/",
"base": null,
"failure": true
},
{
"input": "http://ho%01st/",
"base": null,
"failure": true
},
{
"input": "http://ho%02st/",
"base": null,
"failure": true
},
{
"input": "http://ho%03st/",
"base": null,
"failure": true
},
{
"input": "http://ho%04st/",
"base": null,
"failure": true
},
{
"input": "http://ho%05st/",
"base": null,
"failure": true
},
{
"input": "http://ho%06st/",
"base": null,
"failure": true
},
{
"input": "http://ho%07st/",
"base": null,
"failure": true
},
{
"input": "http://ho%08st/",
"base": null,
"failure": true
},
{
"input": "http://ho%09st/",
"base": null,
"failure": true
},
{
"input": "http://ho%0Ast/",
"base": null,
"failure": true
},
{
"input": "http://ho%0Bst/",
"base": null,
"failure": true
},
{
"input": "http://ho%0Cst/",
"base": null,
"failure": true
},
{
"input": "http://ho%0Dst/",
"base": null,
"failure": true
},
{
"input": "http://ho%0Est/",
"base": null,
"failure": true
},
{
"input": "http://ho%0Fst/",
"base": null,
"failure": true
},
{
"input": "http://ho%10st/",
"base": null,
"failure": true
},
{
"input": "http://ho%11st/",
"base": null,
"failure": true
},
{
"input": "http://ho%12st/",
"base": null,
"failure": true
},
{
"input": "http://ho%13st/",
"base": null,
"failure": true
},
{
"input": "http://ho%14st/",
"base": null,
"failure": true
},
{
"input": "http://ho%15st/",
"base": null,
"failure": true
},
{
"input": "http://ho%16st/",
"base": null,
"failure": true
},
{
"input": "http://ho%17st/",
"base": null,
"failure": true
},
{
"input": "http://ho%18st/",
"base": null,
"failure": true
},
{
"input": "http://ho%19st/",
"base": null,
"failure": true
},
{
"input": "http://ho%1Ast/",
"base": null,
"failure": true
},
{
"input": "http://ho%1Bst/",
"base": null,
"failure": true
},
{
"input": "http://ho%1Cst/",
"base": null,
"failure": true
},
{
"input": "http://ho%1Dst/",
"base": null,
"failure": true
},
{
"input": "http://ho%1Est/",
"base": null,
"failure": true
},
{
"input": "http://ho%1Fst/",
"base": null,
"failure": true
},
{
"input": "http://ho%20st/",
"base": null,
"failure": true
},
{
"input": "http://ho%23st/",
"base": null,
"failure": true
},
{
"input": "http://ho%25st/",
"base": null,
"failure": true
},
{
"input": "http://ho%2Fst/",
"base": null,
"failure": true
},
{
"input": "http://ho%3Ast/",
"base": null,
"failure": true
},
{
"input": "http://ho%3Cst/",
"base": null,
"failure": true
},
{
"input": "http://ho%3Est/",
"base": null,
"failure": true
},
{
"input": "http://ho%3Fst/",
"base": null,
"failure": true
},
{
"input": "http://ho%40st/",
"base": null,
"failure": true
},
{
"input": "http://ho%5Bst/",
"base": null,
"failure": true
},
{
"input": "http://ho%5Cst/",
"base": null,
"failure": true
},
{
"input": "http://ho%5Dst/",
"base": null,
"failure": true
},
{
"input": "http://ho%7Cst/",
"base": null,
"failure": true
},
{
"input": "http://ho%7Fst/",
"base": null,
"failure": true
},
"Allowed host/domain code points",
{
"base": null,
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~",
"hostname": "%01%02%03%04%05%06%07%08%0B%0C%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%7F!\"$%&'()*+,-.;=_`{}~",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# Hosts and percent-encoding",
{
"input": "ftp://example.com%80/",
"base": null,
"failure": true
},
{
"input": "ftp://example.com%A0/",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"input": "ftp://%e2%98%83",
"base": null,
"href": "ftp://xn--n3h/",
"origin": "ftp://xn--n3h",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "xn--n3h",
"hostname": "xn--n3h",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https://%e2%98%83",
"base": null,
"href": "https://xn--n3h/",
"origin": "https://xn--n3h",
"protocol": "https:",
"username": "",
"password": "",
"host": "xn--n3h",
"hostname": "xn--n3h",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# tests from jsdom/whatwg-url designed for code coverage",
{
"base": null,
"origin": "http://127.0.0.1:10100",
"protocol": "http:",
"username": "",
"password": "",
"host": "127.0.0.1:10100",
"hostname": "127.0.0.1",
"port": "10100",
"pathname": "/relative_import.html",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "http://facebook.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "facebook.com",
"hostname": "facebook.com",
"port": "",
"pathname": "/",
"search": "?foo=%7B%22abc%22",
"hash": ""
},
{
"base": null,
"origin": "https://localhost:3000",
"protocol": "https:",
"username": "",
"password": "",
"host": "localhost:3000",
"hostname": "localhost",
"port": "3000",
"pathname": "/jqueryui@1.2.3",
"search": "",
"hash": ""
},
"# tab/LF/CR",
{
"base": null,
"origin": "http://host:9000",
"protocol": "http:",
"username": "",
"password": "",
"host": "host:9000",
"hostname": "host",
"port": "9000",
"pathname": "/path",
"search": "?query",
"hash": "#frag"
},
"# Stringification of URL.searchParams",
{
"input": "?a=b&c=d",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "?a=b&c=d",
"searchParams": "a=b&c=d",
"hash": ""
},
{
"input": "??a=b&c=d",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "??a=b&c=d",
"searchParams": "%3Fa=b&c=d",
"hash": ""
},
"# Scheme only",
{
"input": "http:",
"origin": "http://example.org",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"searchParams": "",
"hash": ""
},
{
"input": "http:",
"failure": true
},
{
"input": "sc:",
"href": "sc:",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"searchParams": "",
"hash": ""
},
"# Percent encoding of fragments",
{
"base": null,
"origin": "http://foo.bar",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%08bar"
},
{
"base": null,
"origin": "http://foo.bar",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%22bar"
},
{
"base": null,
"origin": "http://foo.bar",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%3Cbar"
},
{
"input": "http://foo.bar/baz?qux#foo>bar",
"base": null,
"origin": "http://foo.bar",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%3Ebar"
},
{
"base": null,
"origin": "http://foo.bar",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%60bar"
},
{
"input": "http://1.2.3.4/",
"base": "http://other.com/",
"href": "http://1.2.3.4/",
"origin": "http://1.2.3.4",
"protocol": "http:",
"username": "",
"password": "",
"host": "1.2.3.4",
"hostname": "1.2.3.4",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://1.2.3.4./",
"base": "http://other.com/",
"href": "http://1.2.3.4/",
"origin": "http://1.2.3.4",
"protocol": "http:",
"username": "",
"password": "",
"host": "1.2.3.4",
"hostname": "1.2.3.4",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://192.168.257",
"base": "http://other.com/",
"href": "http://192.168.1.1/",
"origin": "http://192.168.1.1",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.1.1",
"hostname": "192.168.1.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://192.168.257.",
"base": "http://other.com/",
"href": "http://192.168.1.1/",
"origin": "http://192.168.1.1",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.1.1",
"hostname": "192.168.1.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": "http://other.com/",
"origin": "http://192.168.257.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.257.com",
"hostname": "192.168.257.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://256",
"base": "http://other.com/",
"href": "http://0.0.1.0/",
"origin": "http://0.0.1.0",
"protocol": "http:",
"username": "",
"password": "",
"host": "0.0.1.0",
"hostname": "0.0.1.0",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://256.com",
"base": "http://other.com/",
"href": "http://256.com/",
"origin": "http://256.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "256.com",
"hostname": "256.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://999999999",
"base": "http://other.com/",
"origin": "http://59.154.201.255",
"protocol": "http:",
"username": "",
"password": "",
"host": "59.154.201.255",
"hostname": "59.154.201.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://999999999.",
"base": "http://other.com/",
"origin": "http://59.154.201.255",
"protocol": "http:",
"username": "",
"password": "",
"host": "59.154.201.255",
"hostname": "59.154.201.255",
"port": "",
"pathname": "/",
"search": "",
"hash": "",
"failure": true
},
{
"input": "http://999999999.com",
"base": "http://other.com/",
"origin": "http://999999999.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "999999999.com",
"hostname": "999999999.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://10000000000",
"base": "http://other.com/",
"failure": true
},
{
"base": "http://other.com/",
"origin": "http://10000000000.com",
"protocol": "http:",
"username": "",
"password": "",
"host": "10000000000.com",
"hostname": "10000000000.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://4294967295",
"base": "http://other.com/",
"origin": "http://255.255.255.255",
"protocol": "http:",
"username": "",
"password": "",
"host": "255.255.255.255",
"hostname": "255.255.255.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://4294967296",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://0xffffffff",
"base": "http://other.com/",
"origin": "http://255.255.255.255",
"protocol": "http:",
"username": "",
"password": "",
"host": "255.255.255.255",
"hostname": "255.255.255.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://0xffffffff1",
"base": "http://other.com/",
"failure": true
},
{
"base": "http://other.com/",
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
{
"input": "file:///C%3A/",
"base": null,
"href": "file:///C%3A/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C%3A/",
"search": "",
"hash": ""
},
{
"input": "file:///C%7C/",
"base": null,
"href": "file:///C%7C/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C%7C/",
"search": "",
"hash": ""
},
{
"input": "file://%43%3A",
"base": null,
"failure": true
},
{
"input": "file://%43%7C",
"base": null,
"failure": true
},
{
"input": "file://%43|",
"base": null,
"failure": true
},
{
"input": "file://C%7C",
"base": null,
"failure": true
},
{
"input": "file://%43%7C/",
"base": null,
"failure": true
},
{
"input": "https://%43%7C/",
"base": null,
"failure": true
},
{
"input": "asdf://%43|/",
"base": null,
"failure": true
},
{
"input": "asdf://%43%7C/",
"base": null,
"href": "asdf://%43%7C/",
"origin": "null",
"protocol": "asdf:",
"username": "",
"password": "",
"host": "%43%7C",
"hostname": "%43%7C",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
{
"input": "pix/submit.gif",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
"search": "",
"hash": ""
},
{
"input": "..",
"base": "file:///C:/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "..",
"base": "file:///",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# More file URL tests by zcorpan and annevk",
{
"input": "/",
"base": "file:///C:/a/b",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/",
"base": "file://h/C:/a/b",
"href": "file://h/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "h",
"hostname": "h",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/",
"base": "file://h/a/b",
"href": "file://h/",
"protocol": "file:",
"username": "",
"password": "",
"host": "h",
"hostname": "h",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "//d:",
"base": "file:///C:/a/b",
"href": "file:///d:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/d:",
"search": "",
"hash": ""
},
{
"input": "//d:/..",
"base": "file:///C:/a/b",
"href": "file:///d:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/d:/",
"search": "",
"hash": ""
},
{
"input": "..",
"base": "file:///ab:/",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "..",
"base": "file:///1:/",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "",
"href": "file:///test?test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": ""
},
{
"input": "file:",
"href": "file:///test?test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": ""
},
{
"input": "?x",
"href": "file:///test?x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?x",
"hash": ""
},
{
"input": "file:?x",
"href": "file:///test?x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?x",
"hash": ""
},
{
"input": "#x",
"href": "file:///test?test#x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": "#x"
},
{
"input": "file:#x",
"href": "file:///test?test#x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": "#x"
},
"# File URLs and many (back)slashes",
{
"input": "file:\\\\//",
"base": null,
"href": "file:////",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\",
"base": null,
"href": "file:////",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\?fox",
"base": null,
"href": "file:////?fox",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "?fox",
"hash": ""
},
{
"input": "file:\\\\\\\\#guppy",
"base": null,
"href": "file:////#guppy",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": "#guppy"
},
{
"input": "file://spider///",
"base": null,
"href": "file://spider///",
"protocol": "file:",
"username": "",
"password": "",
"host": "spider",
"hostname": "spider",
"port": "",
"pathname": "///",
"search": "",
"hash": ""
},
{
"input": "file:\\\\localhost//",
"base": null,
"href": "file:////",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/localhost//cat",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//localhost//cat",
"search": "",
"hash": ""
},
{
"input": "file://localhost//a//../..//",
"base": null,
"href": "file://///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///",
"search": "",
"hash": ""
},
{
"input": "/////mouse",
"base": "file:///elephant",
"href": "file://///mouse",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///mouse",
"search": "",
"hash": ""
},
{
"input": "\\//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "\\/localhost//pig",
"base": "file://lion/",
"href": "file:////pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//pig",
"search": "",
"hash": ""
},
{
"input": "//localhost//pig",
"base": "file://lion/",
"href": "file:////pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//pig",
"search": "",
"hash": ""
},
{
"input": "/..//localhost//pig",
"base": "file://lion/",
"protocol": "file:",
"username": "",
"password": "",
"host": "lion",
"hostname": "lion",
"port": "",
"pathname": "//localhost//pig",
"search": "",
"hash": ""
},
{
"input": "file://",
"base": "file://ape/",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# File URLs with non-empty hosts",
{
"input": "/rooibos",
"base": "file://tea/",
"href": "file://tea/rooibos",
"protocol": "file:",
"username": "",
"password": "",
"host": "tea",
"hostname": "tea",
"port": "",
"pathname": "/rooibos",
"search": "",
"hash": ""
},
{
"input": "/?chai",
"base": "file://tea/",
"href": "file://tea/?chai",
"protocol": "file:",
"username": "",
"password": "",
"host": "tea",
"hostname": "tea",
"port": "",
"pathname": "/",
"search": "?chai",
"hash": ""
},
"# Windows drive letter handling with the 'file:' base URL",
{
"input": "C|",
"href": "file://host/C:",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|",
"href": "file://host/C:",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|#",
"href": "file://host/C:#",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|?",
"href": "file://host/C:?",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "C|\n/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "C|\\",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "C",
"href": "file://host/dir/C",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/dir/C",
"search": "",
"hash": ""
},
{
"input": "C|a",
"href": "file://host/dir/C|a",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/dir/C|a",
"search": "",
"hash": ""
},
"# Windows drive letter quirk in the file slash state",
{
"input": "/c:/foo/bar",
"base": "file:///c:/baz/qux",
"href": "file:///c:/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/c|/foo/bar",
"base": "file:///c:/baz/qux",
"href": "file:///c:/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "file:\\c:\\foo\\bar",
"base": "file:///c:/baz/qux",
"href": "file:///c:/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/c:/foo/bar",
"base": "file://host/path",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
"# Do not drop the host in the presence of a drive letter",
{
"input": "file://example.net/C:/",
"base": null,
"href": "file://example.net/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "example.net",
"hostname": "example.net",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file://1.2.3.4/C:/",
"base": null,
"href": "file://1.2.3.4/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "1.2.3.4",
"hostname": "1.2.3.4",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file://[1::8]/C:/",
"base": null,
"href": "file://[1::8]/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "[1::8]",
"hostname": "[1::8]",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# Copy the host from the base URL in the following cases",
{
"input": "C|/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/C:/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:C:/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:/C:/",
"base": "file://host/",
"href": "file://host/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# Copy the empty host from the input in the following cases",
{
"input": "//C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file://C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "///C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:///C:/",
"base": "file://host/",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# Windows drive letter quirk (no host)",
{
"input": "file:/C|/",
"base": null,
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file://C|/",
"base": null,
"href": "file:///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# file URLs without base URL by Rimas Misevičius",
{
"input": "file:",
"base": null,
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:?q=v",
"base": null,
"href": "file:///?q=v",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "?q=v",
"hash": ""
},
{
"input": "file:#frag",
"base": null,
"href": "file:///#frag",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": "#frag"
},
"# file: drive letter cases from https://crbug.com/1078698",
{
"input": "file:///Y:",
"base": null,
"href": "file:///Y:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y:",
"search": "",
"hash": ""
},
{
"input": "file:///Y:/",
"base": null,
"href": "file:///Y:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y:/",
"search": "",
"hash": ""
},
{
"input": "file:///./Y",
"base": null,
"href": "file:///Y",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y",
"search": "",
"hash": ""
},
{
"input": "file:///./Y:",
"base": null,
"href": "file:///Y:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y:",
"search": "",
"hash": ""
},
{
"input": "\\\\\\.\\Y:",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
"# file: drive letter cases from https://crbug.com/1078698 but lowercased",
{
"input": "file:///y:",
"base": null,
"href": "file:///y:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y:",
"search": "",
"hash": ""
},
{
"input": "file:///y:/",
"base": null,
"href": "file:///y:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y:/",
"search": "",
"hash": ""
},
{
"input": "file:///./y",
"base": null,
"href": "file:///y",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y",
"search": "",
"hash": ""
},
{
"input": "file:///./y:",
"base": null,
"href": "file:///y:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y:",
"search": "",
"hash": ""
},
{
"input": "\\\\\\.\\y:",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
"# Additional file URL tests for (https://github.com/whatwg/url/issues/405)",
{
"base": null,
"href": "file://///foo",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///foo",
"search": "",
"hash": ""
},
{
"base": null,
"href": "file://////foo",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "////foo",
"search": "",
"hash": ""
},
{
"input": "file:////foo",
"base": null,
"href": "file:////foo",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//foo",
"search": "",
"hash": ""
},
{
"input": "file:///one/two",
"base": "file:///",
"href": "file:///one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/one/two",
"search": "",
"hash": ""
},
{
"input": "file:////one/two",
"base": "file:///",
"href": "file:////one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//one/two",
"search": "",
"hash": ""
},
{
"input": "//one/two",
"base": "file:///",
"href": "file://one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "one",
"hostname": "one",
"port": "",
"pathname": "/two",
"search": "",
"hash": ""
},
{
"input": "///one/two",
"base": "file:///",
"href": "file:///one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/one/two",
"search": "",
"hash": ""
},
{
"input": "////one/two",
"base": "file:///",
"href": "file:////one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//one/two",
"search": "",
"hash": ""
},
{
"input": "file:///.//",
"base": "file:////",
"href": "file:////",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "file:.//p",
"base": null,
"href": "file:////p",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//p",
"search": "",
"hash": ""
},
{
"input": "file:/.//p",
"base": null,
"href": "file:////p",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//p",
"search": "",
"hash": ""
},
"# IPv6 tests",
{
"input": "http://[1:0::]",
"base": "http://example.net/",
"href": "http://[1::]/",
"origin": "http://[1::]",
"protocol": "http:",
"username": "",
"password": "",
"host": "[1::]",
"hostname": "[1::]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": "http://example.net/",
"failure": true
},
{
"input": "https://[0::0::0]",
"base": null,
"failure": true
},
{
"input": "https://[0:.0]",
"base": null,
"failure": true
},
{
"input": "https://[0:0:]",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"input": "https://[0:1.23.23]",
"base": null,
"failure": true
},
"# Empty host",
{
"input": "http://?",
"base": null,
"failure": true
},
{
"input": "http://#",
"base": null,
"failure": true
},
"Port overflow (2^32 + 81)",
{
"input": "http://f:4294967377/c",
"base": "http://example.org/",
"failure": true
},
"Port overflow (2^64 + 81)",
{
"base": "http://example.org/",
"failure": true
},
"Port overflow (2^128 + 81)",
{
"base": "http://example.org/",
"failure": true
},
"# Non-special-URL path tests",
{
"input": "sc://ñ",
"base": null,
"href": "sc://%C3%B1",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "sc://ñ?x",
"base": null,
"href": "sc://%C3%B1?x",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "?x",
"hash": ""
},
{
"input": "sc://ñ#x",
"base": null,
"href": "sc://%C3%B1#x",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "",
"hash": "#x"
},
{
"input": "#x",
"base": "sc://ñ",
"href": "sc://%C3%B1#x",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "",
"hash": "#x"
},
{
"input": "?x",
"base": "sc://ñ",
"href": "sc://%C3%B1?x",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "?x",
"hash": ""
},
{
"input": "sc://?",
"base": null,
"href": "sc://?",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "sc://#",
"base": null,
"href": "sc://#",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "///",
"base": "sc://x/",
"href": "sc:///",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "////",
"base": "sc://x/",
"href": "sc:////",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "////x/",
"base": "sc://x/",
"href": "sc:////x/",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//x/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "tftp:",
"username": "",
"password": "",
"host": "foobar.com",
"hostname": "foobar.com",
"port": "",
"pathname": "/someconfig;mode=netascii",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "telnet:",
"username": "user",
"password": "pass",
"host": "foobar.com:23",
"hostname": "foobar.com",
"port": "23",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "ut2004:",
"username": "",
"password": "",
"host": "10.10.10.10:7777",
"hostname": "10.10.10.10",
"port": "7777",
"pathname": "/Index.ut2",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "redis:",
"username": "foo",
"password": "bar",
"host": "somehost:6379",
"hostname": "somehost",
"port": "6379",
"pathname": "/0",
"search": "?baz=bam&qux=baz",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "rsync:",
"username": "foo",
"password": "",
"host": "host:911",
"hostname": "host",
"port": "911",
"pathname": "/sup",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "git:",
"username": "",
"password": "",
"host": "github.com",
"hostname": "github.com",
"port": "",
"pathname": "/foo/bar.git",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "irc:",
"username": "",
"password": "",
"host": "myserver.com:6999",
"hostname": "myserver.com",
"port": "6999",
"pathname": "/channel",
"search": "?passwd",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "dns:",
"username": "",
"password": "",
"host": "fw.example.org:9999",
"hostname": "fw.example.org",
"port": "9999",
"pathname": "/foo.bar.org",
"search": "?type=TXT",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "ldap:",
"username": "",
"password": "",
"host": "localhost:389",
"hostname": "localhost",
"port": "389",
"pathname": "/ou=People,o=JNDITutorial",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "git+https:",
"username": "",
"password": "",
"host": "github.com",
"hostname": "github.com",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": "urn:ietf:rfc:2648",
"base": null,
"href": "urn:ietf:rfc:2648",
"origin": "null",
"protocol": "urn:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "ietf:rfc:2648",
"search": "",
"hash": ""
},
{
"input": "tag:joe@example.org,2001:foo/bar",
"base": null,
"href": "tag:joe@example.org,2001:foo/bar",
"origin": "null",
"protocol": "tag:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "joe@example.org,2001:foo/bar",
"search": "",
"hash": ""
},
"Serialize /. in path",
{
"input": "non-spec:/.//",
"base": null,
"href": "non-spec:/.//",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "non-spec:/..//",
"base": null,
"href": "non-spec:/.//",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "non-spec:/a/..//",
"base": null,
"href": "non-spec:/.//",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "non-spec:/.//path",
"base": null,
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "non-spec:/..//path",
"base": null,
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "non-spec:/a/..//path",
"base": null,
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "/.//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "/..//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "..//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "a/..//path",
"base": "non-spec:/p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
{
"input": "",
"base": "non-spec:/..//p",
"href": "non-spec:/.//p",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//p",
"search": "",
"hash": ""
},
{
"input": "path",
"base": "non-spec:/..//p",
"href": "non-spec:/.//path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//path",
"search": "",
"hash": ""
},
"Do not serialize /. in path",
{
"input": "../path",
"base": "non-spec:/.//p",
"href": "non-spec:/path",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/path",
"search": "",
"hash": ""
},
"# percent encoded hosts in non-special-URLs",
{
"base": null,
"protocol": "non-special:",
"username": "",
"password": "",
"host": "%E2%80%A0",
"hostname": "%E2%80%A0",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "non-special:",
"username": "",
"password": "",
"host": "H%4fSt",
"hostname": "H%4fSt",
"port": "",
"pathname": "/path",
"search": "",
"hash": ""
},
"# IPv6 in non-special-URLs",
{
"base": null,
"protocol": "non-special:",
"username": "",
"password": "",
"host": "[1:2:0:0:5::]",
"hostname": "[1:2:0:0:5::]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "non-special:",
"username": "",
"password": "",
"host": "[1:2::3]",
"hostname": "[1:2::3]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "non-special:",
"username": "",
"password": "",
"host": "[1:2::3]:80",
"hostname": "[1:2::3]",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "non-special://[:80/",
"base": null,
"failure": true
},
{
"input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
"base": null,
"href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
"search": "",
"hash": ""
},
{
"input": "blob:",
"base": null,
"href": "blob:",
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
"Invalid IPv4 radix digits",
{
"input": "http://0x7f.0.0.0x7g",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "0x7f.0.0.0x7g",
"hostname": "0x7f.0.0.0x7g",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://0X7F.0.0.0X7G",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "0x7f.0.0.0x7g",
"hostname": "0x7f.0.0.0x7g",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Invalid IPv4 portion of IPv6 address",
{
"base": null,
"failure": true
},
"Uncompressed IPv6 addresses with 0",
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "[0:1:0:1:0:1:0:1]",
"hostname": "[0:1:0:1:0:1:0:1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "[1:0:1:0:1:0:1:0]",
"hostname": "[1:0:1:0:1:0:1:0]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Percent-encoded query and fragment",
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?%22",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?%3C",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?%3E",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?%E2%8C%A3",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?%23%23",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?%GH",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#%EF"
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#%GH"
},
"URLs that require a non-about:blank base. (Also serve as invalid base tests.)",
{
"input": "a",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"input": "a/",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"input": "a//",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
"Bases that don't fail to parse but fail to be bases",
{
"input": "test-a-colon.html",
"base": "a:",
"failure": true
},
{
"input": "test-a-colon-b.html",
"base": "a:b",
"failure": true
},
"Other base URL tests, that must succeed",
{
"input": "test-a-colon-slash.html",
"base": "a:/",
"href": "a:/test-a-colon-slash.html",
"protocol": "a:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test-a-colon-slash.html",
"search": "",
"hash": ""
},
{
"input": "test-a-colon-slash-slash.html",
"base": "a://",
"protocol": "a:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test-a-colon-slash-slash.html",
"search": "",
"hash": ""
},
{
"input": "test-a-colon-slash-b.html",
"base": "a:/b",
"href": "a:/test-a-colon-slash-b.html",
"protocol": "a:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test-a-colon-slash-b.html",
"search": "",
"hash": ""
},
{
"input": "test-a-colon-slash-slash-b.html",
"base": "a://b",
"protocol": "a:",
"username": "",
"password": "",
"host": "b",
"hostname": "b",
"port": "",
"pathname": "/test-a-colon-slash-slash-b.html",
"search": "",
"hash": ""
},
"Null code point in fragment",
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#b%00c"
},
{
"base": null,
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#b%00c"
},
{
"input": "non-spec:/test?a#b\u0000c",
"base": null,
"href": "non-spec:/test?a#b%00c",
"protocol": "non-spec:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?a",
"hash": "#b%00c"
},
"First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
{
"input": "10.0.0.7:8080/foo.html",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/some/dir/10.0.0.7:8080/foo.html",
"search": "",
"hash": ""
},
"Subsequent scheme chars - not allowed",
{
"input": "a!@$*=/foo.html",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/some/dir/a!@$*=/foo.html",
"search": "",
"hash": ""
},
"First and subsequent scheme chars - allowed",
{
"input": "a1234567890-+.:foo/bar",
"href": "a1234567890-+.:foo/bar",
"protocol": "a1234567890-+.:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "foo/bar",
"search": "",
"hash": ""
},
"IDNA ignored code points in file URLs hosts",
{
"input": "file://a\u00ADb/p",
"base": null,
"href": "file://ab/p",
"protocol": "file:",
"username": "",
"password": "",
"host": "ab",
"hostname": "ab",
"port": "",
"pathname": "/p",
"search": "",
"hash": ""
},
{
"input": "file://a%C2%ADb/p",
"base": null,
"href": "file://ab/p",
"protocol": "file:",
"username": "",
"password": "",
"host": "ab",
"hostname": "ab",
"port": "",
"pathname": "/p",
"search": "",
"hash": ""
},
"IDNA hostnames which get mapped to 'localhost'",
{
"base": null,
"href": "file:///usr/bin",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/usr/bin",
"search": "",
"hash": ""
},
"Empty host after the domain to ASCII",
{
"input": "file://\u00ad/p",
"base": null,
"failure": true
},
{
"input": "file://%C2%AD/p",
"base": null,
"failure": true
},
{
"input": "file://xn--/p",
"base": null,
"failure": true
},
{
"input": "#link",
"protocol": "https:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/",
"search": "",
"hash": "#link"
},
"UTF-8 percent-encode of C0 control percent-encode set and supersets",
{
"input": "non-special:cannot-be-a-base-url-\u0000\u0001\u001F\u001E\u007E\u007F\u0080",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
"origin": "null",
"password": "",
"pathname": "cannot-be-a-base-url-%00%01%1F%1E~%7F%C2%80",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "#fragment%3C%7Ffragment",
"host": "www.example.com",
"hostname": "www.example.com",
"password": "",
"pathname": "/path%7B%7Fpath.html",
"port": "",
"protocol": "https:",
"search": "?query%27%7F=query",
"username": ""
},
{
"base": "http://example.org",
"hash": "",
"host": "foo",
"hostname": "foo",
"origin": "https://foo",
"password": "pass%5B%7F",
"pathname": "/bar",
"port": "",
"protocol": "https:",
"search": "",
"username": "user"
},
"Tests for the distinct percent-encode sets",
{
"input": "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/",
"port": "",
"protocol": "foo:",
"search": "",
"username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~"
},
{
"input": "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~",
"pathname": "/",
"port": "",
"protocol": "foo:",
"search": "",
"username": "joe"
},
{
"base": null,
"hash": "",
"host": "!\"$%&'()*+,-.;=_`{}~",
"hostname": "!\"$%&'()*+,-.;=_`{}~",
"origin": "null",
"password": "",
"pathname": "/",
"port": "",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
"port": "",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"input": "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/dir/",
"port": "",
"protocol": "foo:",
"search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"username": ""
},
{
"input": "wss://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "wss://host",
"password": "",
"pathname": "/dir/",
"port": "",
"protocol": "wss:",
"search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"username": ""
},
{
"input": "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
"base": null,
"hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/dir/",
"port": "",
"protocol": "foo:",
"search": "",
"username": ""
},
"Ensure that input schemes are not ignored when resolving non-special URLs",
{
"input": "abc:rootless",
"base": "abc://host/path",
"hash": "",
"host": "",
"hostname": "",
"href": "abc:rootless",
"password": "",
"pathname": "rootless",
"port": "",
"protocol": "abc:",
"search": "",
"username": ""
},
{
"input": "abc:rootless",
"base": "abc:/path",
"hash": "",
"host": "",
"hostname": "",
"href": "abc:rootless",
"password": "",
"pathname": "rootless",
"port": "",
"protocol": "abc:",
"search": "",
"username": ""
},
{
"input": "abc:rootless",
"base": "abc:path",
"hash": "",
"host": "",
"hostname": "",
"href": "abc:rootless",
"password": "",
"pathname": "rootless",
"port": "",
"protocol": "abc:",
"search": "",
"username": ""
},
{
"input": "abc:/rooted",
"base": "abc://host/path",
"hash": "",
"host": "",
"hostname": "",
"href": "abc:/rooted",
"password": "",
"pathname": "/rooted",
"port": "",
"protocol": "abc:",
"search": "",
"username": ""
},
"Empty query and fragment with blank should throw an error",
{
"input": "#",
"base": null,
"failure": true,
"relativeTo": "any-base"
},
{
"input": "?",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
"Last component looks like a number, but not valid IPv4",
{
"input": "http://1.2.3.4.5",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://1.2.3.4.5.",
"base": "http://other.com/",
"failure": true
},
{
"input": "http://0..0x300/",
"base": null,
"failure": true
},
{
"input": "http://0..0x300./",
"base": null,
"failure": true
},
{
"base": "http://other.com/",
"failure": true
},
{
"base": "http://other.com/",
"failure": true
},
{
"input": "http://1.2.3.08",
"base": null,
"failure": true
},
{
"input": "http://1.2.3.08.",
"base": null,
"failure": true
},
{
"input": "http://1.2.3.09",
"base": null,
"failure": true
},
{
"input": "http://09.2.3.4",
"base": null,
"failure": true
},
{
"input": "http://09.2.3.4.",
"base": null,
"failure": true
},
{
"input": "http://01.2.3.4.5",
"base": null,
"failure": true
},
{
"input": "http://01.2.3.4.5.",
"base": null,
"failure": true
},
{
"input": "http://0x100.2.3.4",
"base": null,
"failure": true
},
{
"input": "http://0x100.2.3.4.",
"base": null,
"failure": true
},
{
"input": "http://0x1.2.3.4.5",
"base": null,
"failure": true
},
{
"input": "http://0x1.2.3.4.5.",
"base": null,
"failure": true
},
{
"input": "http://foo.1.2.3.4",
"base": null,
"failure": true
},
{
"input": "http://foo.1.2.3.4.",
"base": null,
"failure": true
},
{
"input": "http://foo.2.3.4",
"base": null,
"failure": true
},
{
"input": "http://foo.2.3.4.",
"base": null,
"failure": true
},
{
"input": "http://foo.09",
"base": null,
"failure": true
},
{
"input": "http://foo.09.",
"base": null,
"failure": true
},
{
"input": "http://foo.0x4",
"base": null,
"failure": true
},
{
"input": "http://foo.0x4.",
"base": null,
"failure": true
},
{
"input": "http://foo.09..",
"base": null,
"hash": "",
"host": "foo.09..",
"hostname": "foo.09..",
"href": "http://foo.09../",
"password": "",
"pathname": "/",
"port": "",
"protocol": "http:",
"search": "",
"username": ""
},
{
"base": null,
"failure": true
},
{
"input": "http://foo.0x",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"input": "http://💩.123/",
"base": null,
"failure": true
},
"U+0000 and U+FFFF in various places",
{
"input": "https://\u0000y",
"base": null,
"failure": true
},
{
"input": "https://x/\u0000y",
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"href": "https://x/%00y",
"password": "",
"pathname": "/%00y",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"input": "https://x/?\u0000y",
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"href": "https://x/?%00y",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "?%00y",
"username": ""
},
{
"input": "https://x/?#\u0000y",
"base": null,
"hash": "#%00y",
"host": "x",
"hostname": "x",
"href": "https://x/?#%00y",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"input": "https://\uFFFFy",
"base": null,
"failure": true
},
{
"input": "https://x/\uFFFFy",
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/%EF%BF%BFy",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"input": "https://x/?\uFFFFy",
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "?%EF%BF%BFy",
"username": ""
},
{
"input": "https://x/?#\uFFFFy",
"base": null,
"hash": "#%EF%BF%BFy",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"input": "non-special:\u0000y",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:%00y",
"password": "",
"pathname": "%00y",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "non-special:x/\u0000y",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:x/%00y",
"password": "",
"pathname": "x/%00y",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "non-special:x/?\u0000y",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:x/?%00y",
"password": "",
"pathname": "x/",
"port": "",
"protocol": "non-special:",
"search": "?%00y",
"username": ""
},
{
"input": "non-special:x/?#\u0000y",
"base": null,
"hash": "#%00y",
"host": "",
"hostname": "",
"href": "non-special:x/?#%00y",
"password": "",
"pathname": "x/",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "non-special:\uFFFFy",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:%EF%BF%BFy",
"password": "",
"pathname": "%EF%BF%BFy",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "non-special:x/\uFFFFy",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:x/%EF%BF%BFy",
"password": "",
"pathname": "x/%EF%BF%BFy",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "non-special:x/?\uFFFFy",
"base": null,
"hash": "",
"host": "",
"hostname": "",
"href": "non-special:x/?%EF%BF%BFy",
"password": "",
"pathname": "x/",
"port": "",
"protocol": "non-special:",
"search": "?%EF%BF%BFy",
"username": ""
},
{
"input": "non-special:x/?#\uFFFFy",
"base": null,
"hash": "#%EF%BF%BFy",
"host": "",
"hostname": "",
"href": "non-special:x/?#%EF%BF%BFy",
"password": "",
"pathname": "x/",
"port": "",
"protocol": "non-special:",
"search": "",
"username": ""
},
{
"input": "",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"hash": "",
"host": "example.com",
"hostname": "example.com",
"origin": "https://example.com",
"password": "",
"pathname": "/%22quoted%22",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"input": "https://a%C2%ADb/",
"base": null,
"hash": "",
"host": "ab",
"hostname": "ab",
"href": "https://ab/",
"origin": "https://ab",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"comment": "Empty host after domain to ASCII",
"input": "https://\u00AD/",
"base": null,
"failure": true
},
{
"input": "https://%C2%AD/",
"base": null,
"failure": true
},
{
"input": "https://xn--/",
"base": null,
"failure": true
},
"Non-special schemes that some implementations might incorrectly treat as special",
{
"base": null,
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "data:///test",
"base": null,
"href": "data:///test",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "data://test/a/../b",
"base": null,
"href": "data://test/b",
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "data://:443",
"base": null,
"failure": true
},
{
"input": "data://test:test",
"base": null,
"failure": true
},
{
"input": "data://[:1]",
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "javascript:///test",
"base": null,
"href": "javascript:///test",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"href": "javascript://test/b",
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "javascript://:443",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"input": "javascript://[:1]",
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "mailto:///test",
"base": null,
"href": "mailto:///test",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "mailto://test/a/../b",
"base": null,
"href": "mailto://test/b",
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "mailto://:443",
"base": null,
"failure": true
},
{
"input": "mailto://test:test",
"base": null,
"failure": true
},
{
"input": "mailto://[:1]",
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "intent:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "intent:///test",
"base": null,
"href": "intent:///test",
"origin": "null",
"protocol": "intent:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "intent://test/a/../b",
"base": null,
"href": "intent://test/b",
"origin": "null",
"protocol": "intent:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "intent://:443",
"base": null,
"failure": true
},
{
"input": "intent://test:test",
"base": null,
"failure": true
},
{
"input": "intent://[:1]",
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "urn:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "urn:///test",
"base": null,
"href": "urn:///test",
"origin": "null",
"protocol": "urn:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "urn://test/a/../b",
"base": null,
"href": "urn://test/b",
"origin": "null",
"protocol": "urn:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "urn://:443",
"base": null,
"failure": true
},
{
"input": "urn://test:test",
"base": null,
"failure": true
},
{
"input": "urn://[:1]",
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "turn:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "turn:///test",
"base": null,
"href": "turn:///test",
"origin": "null",
"protocol": "turn:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "turn://test/a/../b",
"base": null,
"href": "turn://test/b",
"origin": "null",
"protocol": "turn:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "turn://:443",
"base": null,
"failure": true
},
{
"input": "turn://test:test",
"base": null,
"failure": true
},
{
"input": "turn://[:1]",
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "stun:",
"username": "",
"password": "",
"host": "example.com:8080",
"hostname": "example.com",
"port": "8080",
"pathname": "/pathname",
"search": "?search",
"hash": "#hash"
},
{
"input": "stun:///test",
"base": null,
"href": "stun:///test",
"origin": "null",
"protocol": "stun:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"input": "stun://test/a/../b",
"base": null,
"href": "stun://test/b",
"origin": "null",
"protocol": "stun:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"input": "stun://:443",
"base": null,
"failure": true
},
{
"input": "stun://test:test",
"base": null,
"failure": true
},
{
"input": "stun://[:1]",
"base": null,
"failure": true
}
]