Skip to content

Commit

Permalink
url: forbid <, > and ^ in hosts
Browse files Browse the repository at this point in the history
Per the change in whatwg/url#459.
  • Loading branch information
djc committed Aug 18, 2020
1 parent 6b05499 commit dce7c6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
7 changes: 7 additions & 0 deletions src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,15 @@ impl Host<String> {
| '%'
| '/'
| ':'
| '<'
| '>'
| '?'
| '@'
| '['
| '\\'
| ']'
| '^'

)
})
.is_some()
Expand Down Expand Up @@ -134,11 +138,14 @@ impl Host<String> {
| '#'
| '/'
| ':'
| '<'
| '>'
| '?'
| '@'
| '['
| '\\'
| ']'
| '^'
)
})
.is_some()
Expand Down
15 changes: 0 additions & 15 deletions tests/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4481,21 +4481,6 @@
"search": "",
"hash": ""
},
{
"input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/",
"base": "about:blank",
"href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
"hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "sc://\u0000/",
"base": "about:blank",
Expand Down

0 comments on commit dce7c6e

Please sign in to comment.