Revision control
Copy as Markdown
Other Tools
[
"# Pulled from https://github.com/web-platform-tests/wpt/blob/befe66343e5f21dc464c8c772c6d20695936714f/url/resources/urltestdata.json",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "user",
"password": "pass",
"host": "foo:21",
"hostname": "foo",
"port": "21",
"pathname": "/bar;par",
"search": "?b",
"hash": "#c"
},
{
"base": null,
"protocol": "https:",
"username": "test",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"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",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/foo.com",
"search": "",
"hash": ""
},
{
"input": "\t :foo.com \n",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:foo.com",
"search": "",
"hash": ""
},
{
"input": " foo.com ",
"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": ""
},
{
"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"
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "f",
"hostname": "f",
"port": "",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "f:0",
"hostname": "f",
"port": "0",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "f:0",
"hostname": "f",
"port": "0",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "f",
"hostname": "f",
"port": "",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"failure": true
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "f",
"hostname": "f",
"port": "",
"pathname": "/c",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"input": "",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": " \t",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": ":foo.com/",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:foo.com/",
"search": "",
"hash": ""
},
{
"input": ":foo.com\\",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:foo.com/",
"search": "",
"hash": ""
},
{
"input": ":",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:",
"search": "",
"hash": ""
},
{
"input": ":a",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:a",
"search": "",
"hash": ""
},
{
"input": ":/",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:/",
"search": "",
"hash": ""
},
{
"input": ":\\",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:/",
"search": "",
"hash": ""
},
{
"input": ":#",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:",
"search": "",
"hash": ""
},
{
"input": "#",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": "#/",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#/"
},
{
"input": "#\\",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#\\"
},
{
"input": "#;?",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": "#;?"
},
{
"input": "?",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": ":23",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:23",
"search": "",
"hash": ""
},
{
"input": "/:23",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/:23",
"search": "",
"hash": ""
},
{
"input": "\\x",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/x",
"search": "",
"hash": ""
},
{
"input": "\\\\x\\hello",
"protocol": "http:",
"username": "",
"password": "",
"host": "x",
"hostname": "x",
"port": "",
"pathname": "/hello",
"search": "",
"hash": ""
},
{
"input": "::",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/::",
"search": "",
"hash": ""
},
{
"input": "::23",
"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": ""
},
{
"protocol": "http:",
"username": "a",
"password": "b",
"host": "c:29",
"hostname": "c",
"port": "29",
"pathname": "/d",
"search": "",
"hash": ""
},
{
"input": "http::@c:29",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/:@c:29",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "&a",
"password": "foo(b%5Dc",
"host": "d:2",
"hostname": "d",
"port": "2",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "%3A%40c",
"host": "d:2",
"hostname": "d",
"port": "2",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "foo.com",
"password": "b",
"host": "d",
"hostname": "d",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.com",
"hostname": "foo.com",
"port": "",
"pathname": "//@",
"search": "",
"hash": ""
},
{
"input": "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\\",
"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": ""
},
{
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///////",
"search": "",
"hash": ""
},
{
"origin": "null",
"protocol": "foo:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///////bar.com/",
"search": "",
"hash": ""
},
{
"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",
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/bar",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/path;a",
"search": "??e",
"hash": "#f#g"
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/abcd",
"search": "?efgh?ijkl",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/abcd",
"search": "",
"hash": "#foo?bar"
},
{
"input": "[61:24:74]:98",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/[61:24:74]:98",
"search": "",
"hash": ""
},
{
"input": "http:[61:27]/:foo",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/[61:27]/:foo",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "[2001::1]",
"hostname": "[2001::1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "[::7f00:1]",
"hostname": "[::7f00:1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "[::d01:4403]",
"hostname": "[::d01:4403]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "[2001::1]",
"hostname": "[2001::1]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/example.com/",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/example.com/",
"search": "",
"hash": ""
},
{
"input": "ftp:/example.com/",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "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": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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/",
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "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/",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/foo/example.com/",
"search": "",
"hash": ""
},
{
"input": "ftp:example.com/",
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "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/",
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "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",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a/b/c",
"search": "",
"hash": ""
},
{
"input": "/a/ /c",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a/%20/c",
"search": "",
"hash": ""
},
{
"input": "/a%2fc",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a%2fc",
"search": "",
"hash": ""
},
{
"input": "/a/%2f/c",
"protocol": "http:",
"username": "",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/a/%2f/c",
"search": "",
"hash": ""
},
{
"input": "#β",
"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": ""
},
{
"origin": "null",
"protocol": "ssh:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/bar.git",
"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": "",
"search": "",
"hash": ""
},
{
"input": "C|/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/C|\\foo\\bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "//C|/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "//server/file",
"protocol": "file:",
"username": "",
"password": "",
"host": "server",
"hostname": "server",
"port": "",
"pathname": "/file",
"search": "",
"hash": ""
},
{
"input": "\\\\server\\file",
"protocol": "file:",
"username": "",
"password": "",
"host": "server",
"hostname": "server",
"port": "",
"pathname": "/file",
"search": "",
"hash": ""
},
{
"input": "/\\server/file",
"protocol": "file:",
"username": "",
"password": "",
"host": "server",
"hostname": "server",
"port": "",
"pathname": "/file",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/foo/bar.txt",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/home/me",
"search": "",
"hash": ""
},
{
"input": "//",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "///test",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"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,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/.foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/..bar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/ton",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/a",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/ton",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/%2e%2",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%2e.bar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo/bar/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%20foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%2",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%2zbar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%2%C3%82%C2%A9zbar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%41%7a",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%C2%91%91",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foo%00%51",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/(%28:%3A%29)",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%3A%3a%3C%3c",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/foobar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "//foo//bar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/@asdf%40",
"search": "",
"hash": ""
},
{
"base": null,
"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,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%E2%80%A5/foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%EF%BB%BF/foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/foo",
"search": "?bar=baz",
"hash": ""
},
{
"base": null,
"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"
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www",
"hostname": "www",
"port": "",
"pathname": "/foo%2Ehtml",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www",
"hostname": "www",
"port": "",
"pathname": "/foo/html",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"protocol": "http:",
"username": "%25DOMAIN",
"password": "foobar",
"host": "foodomain.com",
"hostname": "foodomain.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:\\\\www.google.com\\foo",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.google.com",
"hostname": "www.google.com",
"port": "",
"pathname": "/foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo:81",
"hostname": "foo",
"port": "81",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "httpa:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"protocol": "https:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "https:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "ftp:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "ftp:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "foo:70",
"hostname": "foo",
"port": "70",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "foo:443",
"hostname": "foo",
"port": "443",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo:81",
"hostname": "foo",
"port": "81",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo:443",
"hostname": "foo",
"port": "443",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "ws:",
"username": "",
"password": "",
"host": "foo:815",
"hostname": "foo",
"port": "815",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo:80",
"hostname": "foo",
"port": "80",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo:81",
"hostname": "foo",
"port": "81",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "wss:",
"username": "",
"password": "",
"host": "foo:815",
"hostname": "foo",
"port": "815",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/example.com/",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ftp:/example.com/",
"base": null,
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https:/example.com/",
"base": null,
"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,
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss:/example.com/",
"base": null,
"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": "http:example.com/",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "ftp:example.com/",
"base": null,
"protocol": "ftp:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "https:example.com/",
"base": null,
"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,
"protocol": "ws:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "wss:example.com/",
"base": null,
"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": ""
},
"# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
{
"input": "http:@www.example.com",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/@www.example.com",
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:a:b@www.example.com",
"base": null,
"protocol": "http:",
"username": "a",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/a:b@www.example.com",
"base": null,
"protocol": "http:",
"username": "a",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "a",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "pple.com",
"hostname": "pple.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http::b@www.example.com",
"base": null,
"protocol": "http:",
"username": "",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/:b@www.example.com",
"base": null,
"protocol": "http:",
"username": "",
"password": "b",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"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"
},
{
"input": "http:a:@www.example.com",
"base": null,
"protocol": "http:",
"username": "a",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http:/a:@www.example.com",
"base": null,
"protocol": "http:",
"username": "a",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "http:",
"username": "a",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"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,
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# Others",
{
"input": "/",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "/test.txt",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": ".",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "..",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "test.txt",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "./test.txt",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "../test.txt",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "../aaa/test.txt",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/aaa/test.txt",
"search": "",
"hash": ""
},
{
"input": "../../test.txt",
"protocol": "http:",
"username": "",
"password": "",
"host": "www.example.com",
"hostname": "www.example.com",
"port": "",
"pathname": "/test.txt",
"search": "",
"hash": ""
},
{
"input": "中/test.txt",
"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:...",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/...",
"search": "",
"hash": ""
},
{
"input": "file:..",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:a",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/a",
"search": "",
"hash": ""
},
"Basic canonicalization, uppercase should be converted to lowercase",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "example.com",
"hostname": "example.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
"U+3000 is mapped to U+0020 (space) which is disallowed",
{
"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",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "googoo.com",
"hostname": "googoo.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Leading and trailing C0 control or space",
{
"base": null,
"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)",
{
"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",
{
"failure": true
},
"This is the same as previous but escaped",
{
"failure": true
},
"U+FFFD",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"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.",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "go.com",
"hostname": "go.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"failure": true
},
"...%00 in fullwidth should fail (also as escaped UTF-8 input)",
{
"failure": true
},
{
"failure": true
},
"Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "xn--6qqa088eba",
"hostname": "xn--6qqa088eba",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "https:",
"username": "",
"password": "",
"host": "xn--fa-hia.example",
"hostname": "xn--fa-hia.example",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"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",
{
"failure": true
},
"If we get an invalid character that has been escaped.",
{
"failure": true
},
{
"failure": true
},
"Escaped numbers should be treated like IP addresses if they are.",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.0.1",
"hostname": "192.168.0.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
"Invalid escaping in hosts causes failure",
{
"failure": true
},
"A space in a host causes failure",
{
"failure": true
},
{
"base": null,
"failure": true
},
"Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
{
"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
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"failure": true
},
"Misc Unicode",
{
"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",
{
"protocol": "https:",
"username": "%40test%40test",
"password": "",
"host": "example:800",
"hostname": "example",
"port": "800",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "https:",
"username": "%40%40",
"password": "",
"host": "example",
"hostname": "example",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"non-az-09 characters",
{
"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",
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/",
"search": "?%27",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "notspecial:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/",
"search": "?'",
"hash": ""
},
"# Credentials in base",
{
"input": "/some/path",
"protocol": "http:",
"username": "user",
"password": "",
"host": "example.org",
"hostname": "example.org",
"port": "",
"pathname": "/some/path",
"search": "",
"hash": ""
},
{
"input": "",
"protocol": "http:",
"username": "user",
"password": "pass",
"host": "example.org:21",
"hostname": "example.org",
"port": "21",
"pathname": "/smth",
"search": "",
"hash": ""
},
{
"input": "/some/path",
"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",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "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",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "../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",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/i",
"search": "",
"hash": ""
},
{
"input": "/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",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/pa",
"search": "?i",
"hash": ""
},
{
"input": "?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",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "ho",
"hostname": "ho",
"port": "",
"pathname": "/pa",
"search": "",
"hash": "#i"
},
{
"input": "#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": "about:/../",
"base": null,
"href": "about:/",
"origin": "null",
"protocol": "about:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"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",
{
"base": null,
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1.test",
"hostname": "%C3%B1.test",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "sc:",
"username": "",
"password": "",
"host": "%",
"hostname": "%",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"input": "sc://:/",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"input": "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",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"Forbidden host codepoints: tabs and newlines are removed during preprocessing",
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
"Forbidden domain code-points",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"Forbidden domain codepoints: tabs and newlines are removed during preprocessing",
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "http:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "http:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "http:",
"search": "",
"username": ""
},
"Encoded forbidden domain codepoints in special URLs",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"Allowed host/domain code points",
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "!\"$&'()*+,-.;=_`{}~",
"hostname": "!\"$&'()*+,-.;=_`{}~",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"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",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"protocol": "ftp:",
"username": "",
"password": "",
"host": "xn--n3h",
"hostname": "xn--n3h",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"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,
"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,
"protocol": "http:",
"username": "",
"password": "",
"host": "facebook.com",
"hostname": "facebook.com",
"port": "",
"pathname": "/",
"search": "?foo=%7B%22abc%22",
"hash": ""
},
{
"base": null,
"protocol": "https:",
"username": "",
"password": "",
"host": "localhost:3000",
"hostname": "localhost",
"port": "3000",
"pathname": "/jqueryui@1.2.3",
"search": "",
"hash": ""
},
"# tab/LF/CR",
{
"base": null,
"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",
"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",
"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:",
"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,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%08bar"
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%22bar"
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%3Cbar"
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%3Ebar"
},
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "foo.bar",
"hostname": "foo.bar",
"port": "",
"pathname": "/baz",
"search": "?qux",
"searchParams": "qux=",
"hash": "#foo%60bar"
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "1.2.3.4",
"hostname": "1.2.3.4",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "1.2.3.4",
"hostname": "1.2.3.4",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.1.1",
"hostname": "192.168.1.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.1.1",
"hostname": "192.168.1.1",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "192.168.257.com",
"hostname": "192.168.257.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "0.0.1.0",
"hostname": "0.0.1.0",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "256.com",
"hostname": "256.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "59.154.201.255",
"hostname": "59.154.201.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "59.154.201.255",
"hostname": "59.154.201.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "999999999.com",
"hostname": "999999999.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "10000000000.com",
"hostname": "10000000000.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "255.255.255.255",
"hostname": "255.255.255.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"protocol": "http:",
"username": "",
"password": "",
"host": "255.255.255.255",
"hostname": "255.255.255.255",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"failure": true
},
{
"base": null,
"protocol": "https:",
"username": "",
"password": "",
"host": "0.0.0.0",
"hostname": "0.0.0.0",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C%3A/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C%7C/",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "asdf:",
"username": "",
"password": "",
"host": "%43%7C",
"hostname": "%43%7C",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "pix/submit.gif",
"href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/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": "..",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "..",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# More file URL tests by zcorpan and annevk",
{
"input": "/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/",
"protocol": "file:",
"username": "",
"password": "",
"host": "h",
"hostname": "h",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/",
"protocol": "file:",
"username": "",
"password": "",
"host": "h",
"hostname": "h",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "//d:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/d:",
"search": "",
"hash": ""
},
{
"input": "//d:/..",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/d:/",
"search": "",
"hash": ""
},
{
"input": "..",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "..",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": ""
},
{
"input": "file:",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": ""
},
{
"input": "?x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?x",
"hash": ""
},
{
"input": "file:?x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?x",
"hash": ""
},
{
"input": "#x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": "#x"
},
{
"input": "file:#x",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "?test",
"hash": "#x"
},
"# File URLs and many (back)slashes",
{
"input": "file:\\\\//",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\?fox",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "?fox",
"hash": ""
},
{
"input": "file:\\\\\\\\#guppy",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": "#guppy"
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "spider",
"hostname": "spider",
"port": "",
"pathname": "///",
"search": "",
"hash": ""
},
{
"input": "file:\\\\localhost//",
"base": null,
"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": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///",
"search": "",
"hash": ""
},
{
"input": "/////mouse",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///mouse",
"search": "",
"hash": ""
},
{
"input": "\\//pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "\\/localhost//pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//pig",
"search": "",
"hash": ""
},
{
"input": "//localhost//pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//pig",
"search": "",
"hash": ""
},
{
"input": "/..//localhost//pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "lion",
"hostname": "lion",
"port": "",
"pathname": "//localhost//pig",
"search": "",
"hash": ""
},
{
"input": "file://",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"# File URLs with non-empty hosts",
{
"input": "/rooibos",
"protocol": "file:",
"username": "",
"password": "",
"host": "tea",
"hostname": "tea",
"port": "",
"pathname": "/rooibos",
"search": "",
"hash": ""
},
{
"input": "/?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|",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|#",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|?",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:",
"search": "",
"hash": ""
},
{
"input": "C|/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "C|\n/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "C|\\",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "C",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/dir/C",
"search": "",
"hash": ""
},
{
"input": "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",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/c|/foo/bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "file:\\c:\\foo\\bar",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/c:/foo/bar",
"search": "",
"hash": ""
},
{
"input": "/c:/foo/bar",
"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",
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "example.net",
"hostname": "example.net",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "1.2.3.4",
"hostname": "1.2.3.4",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"base": null,
"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|/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "/C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "host",
"hostname": "host",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "file:/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:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "///C:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# Windows drive letter quirk (no host)",
{
"input": "file:/C|/",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
"# file URLs without base URL by Rimas Misevičius",
{
"input": "file:",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:?q=v",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "?q=v",
"hash": ""
},
{
"input": "file:#frag",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": "#frag"
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y:",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y:/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/Y:",
"search": "",
"hash": ""
},
{
"input": "\\\\\\.\\Y:",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y:",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y:/",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/y:",
"search": "",
"hash": ""
},
{
"input": "\\\\\\.\\y:",
"base": null,
"failure": true,
"relativeTo": "non-opaque-path-base"
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "///foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "////foo",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//foo",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/one/two",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//one/two",
"search": "",
"hash": ""
},
{
"input": "//one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "one",
"hostname": "one",
"port": "",
"pathname": "/two",
"search": "",
"hash": ""
},
{
"input": "///one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/one/two",
"search": "",
"hash": ""
},
{
"input": "////one/two",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//one/two",
"search": "",
"hash": ""
},
{
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "file:.//p",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//p",
"search": "",
"hash": ""
},
{
"input": "file:/.//p",
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//p",
"search": "",
"hash": ""
},
"# IPv6 tests",
{
"protocol": "http:",
"username": "",
"password": "",
"host": "[1::]",
"hostname": "[1::]",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"# Empty host",
{
"input": "http://?",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"Port overflow (2^32 + 81)",
{
"failure": true
},
"Port overflow (2^64 + 81)",
{
"failure": true
},
"Port overflow (2^128 + 81)",
{
"failure": true
},
"# Non-special-URL path tests",
{
"base": null,
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "?x",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "",
"hash": "#x"
},
{
"input": "#x",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%C3%B1",
"hostname": "%C3%B1",
"port": "",
"pathname": "",
"search": "",
"hash": "#x"
},
{
"input": "?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": ""
},
{
"base": null,
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "",
"search": "",
"hash": ""
},
{
"input": "///",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "////",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "//",
"search": "",
"hash": ""
},
{
"input": "////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": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
{
"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": ""
},
"blob: in blob:",
{
"input": "blob:blob:",
"base": null,
"href": "blob:blob:",
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "blob:",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
"Non-http(s): in blob:",
{
"input": "blob:about:blank",
"base": null,
"href": "blob:about:blank",
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "about:blank",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"search": "",
"hash": ""
},
"Percent-encoded http: in blob:",
{
"input": "blob:http%3a//example.org/",
"base": null,
"href": "blob:http%3a//example.org/",
"origin": "null",
"protocol": "blob:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "http%3a//example.org/",
"search": "",
"hash": ""
},
"Invalid IPv4 radix digits",
{
"base": null,
"protocol": "http:",
"username": "",
"password": "",
"host": "0x7f.0.0.0x7g",
"hostname": "0x7f.0.0.0x7g",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"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",
"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"
},
{
"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",
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "ab",
"hostname": "ab",
"port": "",
"pathname": "/p",
"search": "",
"hash": ""
},
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "ab",
"hostname": "ab",
"port": "",
"pathname": "/p",
"search": "",
"hash": ""
},
"IDNA hostnames which get mapped to 'localhost'",
{
"base": null,
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/usr/bin",
"search": "",
"hash": ""
},
"Empty host after the domain to ASCII",
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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": ""
},
{
"hash": "",
"host": "foo",
"hostname": "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": "wss:// !\"$%&'()*+,-.;<=>@[]^_`{|}~@host/",
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/",
"port":"",
"protocol": "wss:",
"search": "",
"username": "%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~"
},
{
"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": "host",
"hostname": "host",
"password": "%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~",
"pathname": "/",
"port":"",
"protocol": "wss:",
"search": "",
"username": "joe"
},
{
"base": null,
"hash": "",
"host": "!\"$%&'()*+,-.;=_`{}~",
"hostname": "!\"$%&'()*+,-.;=_`{}~",
"origin": "null",
"password": "",
"pathname": "/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "!\"$&'()*+,-.;=_`{}~",
"hostname": "!\"$&'()*+,-.;=_`{}~",
"password": "",
"pathname": "/",
"port":"",
"protocol": "wss:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~",
"port":"",
"protocol": "wss:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "foo:",
"search": "?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"username": ""
},
{
"base": null,
"hash": "",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "wss:",
"search": "?%20!%22$%&%27()*+,-./:;%3C=%3E?@[\\]^_`{|}~",
"username": ""
},
{
"base": null,
"hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"host": "host",
"hostname": "host",
"origin": "null",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "foo:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~",
"host": "host",
"hostname": "host",
"password": "",
"pathname": "/dir/",
"port":"",
"protocol": "wss:",
"search": "",
"username": ""
},
"Ensure that input schemes are not ignored when resolving non-special URLs",
{
"input": "abc:rootless",
"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",
"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",
{
"failure": true
},
{
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"failure": true
},
{
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"hash": "",
"host": "foo.09..",
"hostname": "foo.09..",
"password": "",
"pathname": "/",
"port":"",
"protocol": "http:",
"search": "",
"username": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
"U+0000 and U+FFFF in various places",
{
"base": null,
"failure": true
},
{
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/%00y",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "?%00y",
"username": ""
},
{
"base": null,
"hash": "#%00y",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/%EF%BF%BFy",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "x",
"hostname": "x",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "?%EF%BF%BFy",
"username": ""
},
{
"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",
"password": "",
"pathname": "/%22quoted%22",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"base": null,
"hash": "",
"host": "ab",
"hostname": "ab",
"password": "",
"pathname": "/",
"port": "",
"protocol": "https:",
"search": "",
"username": ""
},
{
"comment": "Empty host after domain to ASCII",
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "data:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "javascript:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "mailto:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "intent:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "intent:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "urn:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "urn:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "turn:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "turn:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"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"
},
{
"base": null,
"origin": "null",
"protocol": "stun:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/test",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "stun:",
"username": "",
"password": "",
"host": "test",
"hostname": "test",
"port": "",
"pathname": "/b",
"search": "",
"hash": ""
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"failure": true
},
{
"base": null,
"origin": "null",
"protocol": "w:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
},
{
"base": null,
"origin": "null",
"protocol": "west:",
"username": "",
"password": "",
"host": "x:0",
"hostname": "x",
"port": "0",
"pathname": "",
"search": "",
"hash": ""
}
]