Ver código fonte

url: forbid <, > and ^ in hosts

Per the change in https://github.com/whatwg/url/pull/459.
Dirkjan Ochtman 6 anos atrás
pai
commit
dce7c6e58b
2 arquivos alterados com 7 adições e 15 exclusões
  1. 7 0
      src/host.rs
  2. 0 15
      tests/urltestdata.json

+ 7 - 0
src/host.rs

@@ -97,11 +97,15 @@ impl Host<String> {
                         | '%'
                         | '/'
                         | ':'
+                        | '<'
+                        | '>'
                         | '?'
                         | '@'
                         | '['
                         | '\\'
                         | ']'
+                        | '^'
+
                 )
             })
             .is_some()
@@ -134,11 +138,14 @@ impl Host<String> {
                         | '#'
                         | '/'
                         | ':'
+                        | '<'
+                        | '>'
                         | '?'
                         | '@'
                         | '['
                         | '\\'
                         | ']'
+                        | '^'
                 )
             })
             .is_some()

+ 0 - 15
tests/urltestdata.json

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