Skip to content

Commit dce7c6e

Browse files
committed
url: forbid <, > and ^ in hosts
Per the change in whatwg/url#459.
1 parent 6b05499 commit dce7c6e

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

src/host.rs

+7
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,15 @@ impl Host<String> {
9797
| '%'
9898
| '/'
9999
| ':'
100+
| '<'
101+
| '>'
100102
| '?'
101103
| '@'
102104
| '['
103105
| '\\'
104106
| ']'
107+
| '^'
108+
105109
)
106110
})
107111
.is_some()
@@ -134,11 +138,14 @@ impl Host<String> {
134138
| '#'
135139
| '/'
136140
| ':'
141+
| '<'
142+
| '>'
137143
| '?'
138144
| '@'
139145
| '['
140146
| '\\'
141147
| ']'
148+
| '^'
142149
)
143150
})
144151
.is_some()

tests/urltestdata.json

-15
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",

0 commit comments

Comments
 (0)