Skip to content

Commit 01d7c19

Browse files
MattMenke2moz-wptsync-bot
authored andcommitted
Bug 1720566 [wpt PR 29666] - Update URL tests to reject hostnames that end in numbers but are not IPv4 IPs, a=testonly
Automatic update from web-platform-tests Reject hostnames that end in numbers but are not IPv4 IPs Follows whatwg/url#619, and adds more coverage to this area generally. -- wpt-commits: a85b7d62bd2788e36e6e83c043f86b3ba1e6a9ec wpt-pr: 29666
1 parent 039c9b0 commit 01d7c19

File tree

1 file changed

+186
-44
lines changed

1 file changed

+186
-44
lines changed

testing/web-platform/tests/url/resources/urltestdata.json

+186-44
Original file line numberDiff line numberDiff line change
@@ -3896,21 +3896,6 @@
38963896
"search": "",
38973897
"hash": ""
38983898
},
3899-
{
3900-
"input": "http://0..0x300/",
3901-
"base": "about:blank",
3902-
"href": "http://0..0x300/",
3903-
"origin": "http://0..0x300",
3904-
"protocol": "http:",
3905-
"username": "",
3906-
"password": "",
3907-
"host": "0..0x300",
3908-
"hostname": "0..0x300",
3909-
"port": "",
3910-
"pathname": "/",
3911-
"search": "",
3912-
"hash": ""
3913-
},
39143899
"Broken IPv6",
39153900
{
39163901
"input": "http://[www.google.com]/",
@@ -5161,6 +5146,36 @@
51615146
"hash": "#foo%60bar"
51625147
},
51635148
"# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
5149+
{
5150+
"input": "http://1.2.3.4/",
5151+
"base": "http://other.com/",
5152+
"href": "http://1.2.3.4/",
5153+
"origin": "http://1.2.3.4",
5154+
"protocol": "http:",
5155+
"username": "",
5156+
"password": "",
5157+
"host": "1.2.3.4",
5158+
"hostname": "1.2.3.4",
5159+
"port": "",
5160+
"pathname": "/",
5161+
"search": "",
5162+
"hash": ""
5163+
},
5164+
{
5165+
"input": "http://1.2.3.4./",
5166+
"base": "http://other.com/",
5167+
"href": "http://1.2.3.4/",
5168+
"origin": "http://1.2.3.4",
5169+
"protocol": "http:",
5170+
"username": "",
5171+
"password": "",
5172+
"host": "1.2.3.4",
5173+
"hostname": "1.2.3.4",
5174+
"port": "",
5175+
"pathname": "/",
5176+
"search": "",
5177+
"hash": ""
5178+
},
51645179
{
51655180
"input": "http://192.168.257",
51665181
"base": "http://other.com/",
@@ -5176,6 +5191,21 @@
51765191
"search": "",
51775192
"hash": ""
51785193
},
5194+
{
5195+
"input": "http://192.168.257.",
5196+
"base": "http://other.com/",
5197+
"href": "http://192.168.1.1/",
5198+
"origin": "http://192.168.1.1",
5199+
"protocol": "http:",
5200+
"username": "",
5201+
"password": "",
5202+
"host": "192.168.1.1",
5203+
"hostname": "192.168.1.1",
5204+
"port": "",
5205+
"pathname": "/",
5206+
"search": "",
5207+
"hash": ""
5208+
},
51795209
{
51805210
"input": "http://192.168.257.com",
51815211
"base": "http://other.com/",
@@ -5236,6 +5266,21 @@
52365266
"search": "",
52375267
"hash": ""
52385268
},
5269+
{
5270+
"input": "http://999999999.",
5271+
"base": "http://other.com/",
5272+
"href": "http://59.154.201.255/",
5273+
"origin": "http://59.154.201.255",
5274+
"protocol": "http:",
5275+
"username": "",
5276+
"password": "",
5277+
"host": "59.154.201.255",
5278+
"hostname": "59.154.201.255",
5279+
"port": "",
5280+
"pathname": "/",
5281+
"search": "",
5282+
"hash": ""
5283+
},
52395284
{
52405285
"input": "http://999999999.com",
52415286
"base": "http://other.com/",
@@ -5316,21 +5361,6 @@
53165361
"base": "http://other.com/",
53175362
"failure": true
53185363
},
5319-
{
5320-
"input": "http://256.256.256.256.256",
5321-
"base": "http://other.com/",
5322-
"href": "http://256.256.256.256.256/",
5323-
"origin": "http://256.256.256.256.256",
5324-
"protocol": "http:",
5325-
"username": "",
5326-
"password": "",
5327-
"host": "256.256.256.256.256",
5328-
"hostname": "256.256.256.256.256",
5329-
"port": "",
5330-
"pathname": "/",
5331-
"search": "",
5332-
"hash": ""
5333-
},
53345364
{
53355365
"input": "https://0x.0x.0",
53365366
"base": "about:blank",
@@ -7298,20 +7328,6 @@
72987328
"hash": ""
72997329
},
73007330
"Invalid IPv4 radix digits",
7301-
{
7302-
"input": "http://0177.0.0.0189",
7303-
"base": "about:blank",
7304-
"href": "http://0177.0.0.0189/",
7305-
"protocol": "http:",
7306-
"username": "",
7307-
"password": "",
7308-
"host": "0177.0.0.0189",
7309-
"hostname": "0177.0.0.0189",
7310-
"port": "",
7311-
"pathname": "/",
7312-
"search": "",
7313-
"hash": ""
7314-
},
73157331
{
73167332
"input": "http://0x7f.0.0.0x7g",
73177333
"base": "about:blank",
@@ -8031,5 +8047,131 @@
80318047
"input": "?",
80328048
"base": null,
80338049
"failure": true
8050+
},
8051+
"Last component looks like a number, but not valid IPv4",
8052+
{
8053+
"input": "http://1.2.3.4.5",
8054+
"base": "http://other.com/",
8055+
"failure": true
8056+
},
8057+
{
8058+
"input": "http://1.2.3.4.5.",
8059+
"base": "http://other.com/",
8060+
"failure": true
8061+
},
8062+
{
8063+
"input": "http://0..0x300/",
8064+
"base": "about:blank",
8065+
"failure": true
8066+
},
8067+
{
8068+
"input": "http://0..0x300./",
8069+
"base": "about:blank",
8070+
"failure": true
8071+
},
8072+
{
8073+
"input": "http://256.256.256.256.256",
8074+
"base": "http://other.com/",
8075+
"failure": true
8076+
},
8077+
{
8078+
"input": "http://256.256.256.256.256.",
8079+
"base": "http://other.com/",
8080+
"failure": true
8081+
},
8082+
{
8083+
"input": "http://1.2.3.08",
8084+
"base": "about:blank",
8085+
"failure": true
8086+
},
8087+
{
8088+
"input": "http://1.2.3.08.",
8089+
"base": "about:blank",
8090+
"failure": true
8091+
},
8092+
{
8093+
"input": "http://1.2.3.09",
8094+
"base": "about:blank",
8095+
"failure": true
8096+
},
8097+
{
8098+
"input": "http://09.2.3.4",
8099+
"base": "about:blank",
8100+
"failure": true
8101+
},
8102+
{
8103+
"input": "http://09.2.3.4.",
8104+
"base": "about:blank",
8105+
"failure": true
8106+
},
8107+
{
8108+
"input": "http://01.2.3.4.5",
8109+
"base": "about:blank",
8110+
"failure": true
8111+
},
8112+
{
8113+
"input": "http://01.2.3.4.5.",
8114+
"base": "about:blank",
8115+
"failure": true
8116+
},
8117+
{
8118+
"input": "http://0x100.2.3.4",
8119+
"base": "about:blank",
8120+
"failure": true
8121+
},
8122+
{
8123+
"input": "http://0x100.2.3.4.",
8124+
"base": "about:blank",
8125+
"failure": true
8126+
},
8127+
{
8128+
"input": "http://0x1.2.3.4.5",
8129+
"base": "about:blank",
8130+
"failure": true
8131+
},
8132+
{
8133+
"input": "http://0x1.2.3.4.5.",
8134+
"base": "about:blank",
8135+
"failure": true
8136+
},
8137+
{
8138+
"input": "http://foo.1.2.3.4",
8139+
"base": "about:blank",
8140+
"failure": true
8141+
},
8142+
{
8143+
"input": "http://foo.1.2.3.4.",
8144+
"base": "about:blank",
8145+
"failure": true
8146+
},
8147+
{
8148+
"input": "http://foo.2.3.4",
8149+
"base": "about:blank",
8150+
"failure": true
8151+
},
8152+
{
8153+
"input": "http://foo.2.3.4.",
8154+
"base": "about:blank",
8155+
"failure": true
8156+
},
8157+
{
8158+
"input": "http://foo.09",
8159+
"base": "about:blank",
8160+
"failure": true
8161+
},
8162+
{
8163+
"input": "http://foo.09.",
8164+
"base": "about:blank",
8165+
"failure": true
8166+
},
8167+
{
8168+
"input": "http://foo.0x4",
8169+
"base": "about:blank",
8170+
"failure": true
8171+
},
8172+
{
8173+
"input": "http://foo.0x4.",
8174+
"base": "about:blank",
8175+
"failure": true
80348176
}
80358177
]

0 commit comments

Comments
 (0)