Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9be51ee

Browse filesBrowse files
yashLadhaBridgeAR
authored andcommitted
url: forbid lt and gt in url host code point
As per the recent changes in whatwg/url spec. lt and gt are also added in the list of forbidden hostCodePoint list. PR-URL: #33328 Refs: whatwg/url#459 Refs: #33315 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 32b641e commit 9be51ee
Copy full SHA for 9be51ee

File tree

Expand file treeCollapse file tree

2 files changed

+64
-16
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+64
-16
lines changed
Open diff view settings
Collapse file

‎src/node_url.cc‎

Copy file name to clipboardExpand all lines: src/node_url.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ CHAR_TEST(8, IsForbiddenHostCodePoint,
206206
ch == '\0' || ch == '\t' || ch == '\n' || ch == '\r' ||
207207
ch == ' ' || ch == '#' || ch == '%' || ch == '/' ||
208208
ch == ':' || ch == '?' || ch == '@' || ch == '[' ||
209-
ch == '\\' || ch == ']')
209+
ch == '<' || ch == '>' || ch == '\\' || ch == ']' ||
210+
ch == '^')
210211

211212
// https://url.spec.whatwg.org/#windows-drive-letter
212213
TWO_CHAR_STRING_TEST(8, IsWindowsDriveLetter,
Collapse file

‎test/fixtures/wpt/url/resources/urltestdata.json‎

Copy file name to clipboardExpand all lines: test/fixtures/wpt/url/resources/urltestdata.json
+62-15Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4481,21 +4481,6 @@
44814481
"search": "",
44824482
"hash": ""
44834483
},
4484-
{
4485-
"input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/",
4486-
"base": "about:blank",
4487-
"href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/",
4488-
"origin": "null",
4489-
"protocol": "sc:",
4490-
"username": "",
4491-
"password": "",
4492-
"host": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
4493-
"hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
4494-
"port": "",
4495-
"pathname": "/",
4496-
"search": "",
4497-
"hash": ""
4498-
},
44994484
{
45004485
"input": "sc://\u0000/",
45014486
"base": "about:blank",
@@ -4649,6 +4634,68 @@
46494634
"search": "",
46504635
"hash": ""
46514636
},
4637+
"Forbidden host code points",
4638+
{
4639+
"input": "http://a<b",
4640+
"base": "about:blank",
4641+
"failure": true
4642+
},
4643+
{
4644+
"input": "http://a>b",
4645+
"base": "about:blank",
4646+
"failure": true
4647+
},
4648+
{
4649+
"input": "http://a^b",
4650+
"base": "about:blank",
4651+
"failure": true
4652+
},
4653+
{
4654+
"input": "non-special://a<b",
4655+
"base": "about:blank",
4656+
"failure": true
4657+
},
4658+
{
4659+
"input": "non-special://a>b",
4660+
"base": "about:blank",
4661+
"failure": true
4662+
},
4663+
{
4664+
"input": "non-special://a^b",
4665+
"base": "about:blank",
4666+
"failure": true
4667+
},
4668+
"Allowed host code points",
4669+
{
4670+
"input": "http://\u001F!\"$&'()*+,-.;=_`{|}~/",
4671+
"base": "about:blank",
4672+
"href": "http://\u001F!\"$&'()*+,-.;=_`{|}~/",
4673+
"origin": "http://\u001F!\"$&'()*+,-.;=_`{|}~",
4674+
"protocol": "http:",
4675+
"username": "",
4676+
"password": "",
4677+
"host": "\u001F!\"$&'()*+,-.;=_`{|}~",
4678+
"hostname": "\u001F!\"$&'()*+,-.;=_`{|}~",
4679+
"port": "",
4680+
"pathname": "/",
4681+
"search": "",
4682+
"hash": ""
4683+
},
4684+
{
4685+
"input": "sc://\u001F!\"$&'()*+,-.;=_`{|}~/",
4686+
"base": "about:blank",
4687+
"href": "sc://%1F!\"$&'()*+,-.;=_`{|}~/",
4688+
"origin": "null",
4689+
"protocol": "sc:",
4690+
"username": "",
4691+
"password": "",
4692+
"host": "%1F!\"$&'()*+,-.;=_`{|}~",
4693+
"hostname": "%1F!\"$&'()*+,-.;=_`{|}~",
4694+
"port": "",
4695+
"pathname": "/",
4696+
"search": "",
4697+
"hash": ""
4698+
},
46524699
"# Hosts and percent-encoding",
46534700
{
46544701
"input": "ftp://example.com%80/",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.