Skip to content

Commit

Permalink
Test how URL parser handles domains with empty labels
Browse files Browse the repository at this point in the history
The test covers  https://url.spec.whatwg.org/#concept-ipv4-parser 6.1 item:
> 1. If part is the empty string, return input.

Related issue: jsdom/whatwg-url#82
  • Loading branch information
rmisev authored and domenic committed Apr 24, 2017
1 parent 79ec541 commit 3afae94
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions url/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3782,6 +3782,52 @@
"search": "",
"hash": ""
},
"Domains with empty labels",
{
"input": "http://./",
"base": "about:blank",
"href": "http://./",
"origin": "http://.",
"protocol": "http:",
"username": "",
"password": "",
"host": ".",
"hostname": ".",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://../",
"base": "about:blank",
"href": "http://../",
"origin": "http://..",
"protocol": "http:",
"username": "",
"password": "",
"host": "..",
"hostname": "..",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "http://0..0x300/",
"base": "about:blank",
"href": "http://0..0x300/",
"origin": "http://0..0x300",
"protocol": "http:",
"username": "",
"password": "",
"host": "0..0x300",
"hostname": "0..0x300",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
"Broken IPv6",
{
"input": "http://[www.google.com]/",
Expand Down

0 comments on commit 3afae94

Please sign in to comment.