Przeglądaj źródła

Encode { and } in username/password/path, per spec change.

https://github.com/whatwg/url/commit/c296e2f8519a1d6614d664708d368a342682c9a1
Simon Sapin 11 lat temu
rodzic
commit
79a9ef12c1
2 zmienionych plików z 10 dodań i 8 usunięć
  1. 4 4
      make_encode_sets.py
  2. 6 4
      src/encode_sets.rs

+ 4 - 4
make_encode_sets.py

@@ -24,10 +24,10 @@ print('''\
 for name, encoded in [
     ('SIMPLE',   ''),
     ('QUERY',    r''' "#<>`'''),
-    ('DEFAULT',  r''' "#<>`?'''),
-    ('USERINFO', r''' "#<>`?@'''),
-    ('PASSWORD', r''' "#<>`?@\/'''),
-    ('USERNAME', r''' "#<>`?@\/:'''),
+    ('DEFAULT',  r''' "#<>`?{}'''),
+    ('USERINFO', r''' "#<>`?{}@'''),
+    ('PASSWORD', r''' "#<>`?{}@\/'''),
+    ('USERNAME', r''' "#<>`?{}@\/:'''),
     ('FORM_URLENCODED', r''' !"#$%&\'()+,/:;<=>?@[\]^`{|}~'''),
 ]:
     print(

+ 6 - 4
src/encode_sets.rs

@@ -96,7 +96,7 @@ pub static DEFAULT: [&'static str; 256] = [
    "%60", "a", "b", "c", "d", "e", "f", "g",
    "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w",
-   "x", "y", "z", "{", "|", "}", "~", "%7F",
+   "x", "y", "z", "%7B", "|", "%7D", "~", "%7F",
    "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
    "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F",
    "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
@@ -132,7 +132,7 @@ pub static USERINFO: [&'static str; 256] = [
    "%60", "a", "b", "c", "d", "e", "f", "g",
    "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w",
-   "x", "y", "z", "{", "|", "}", "~", "%7F",
+   "x", "y", "z", "%7B", "|", "%7D", "~", "%7F",
    "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
    "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F",
    "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
@@ -168,7 +168,7 @@ pub static PASSWORD: [&'static str; 256] = [
    "%60", "a", "b", "c", "d", "e", "f", "g",
    "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w",
-   "x", "y", "z", "{", "|", "}", "~", "%7F",
+   "x", "y", "z", "%7B", "|", "%7D", "~", "%7F",
    "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
    "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F",
    "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
@@ -204,7 +204,7 @@ pub static USERNAME: [&'static str; 256] = [
    "%60", "a", "b", "c", "d", "e", "f", "g",
    "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w",
-   "x", "y", "z", "{", "|", "}", "~", "%7F",
+   "x", "y", "z", "%7B", "|", "%7D", "~", "%7F",
    "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
    "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F",
    "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
@@ -258,3 +258,5 @@ pub static FORM_URLENCODED: [&'static str; 256] = [
    "%F0", "%F1", "%F2", "%F3", "%F4", "%F5", "%F6", "%F7",
    "%F8", "%F9", "%FA", "%FB", "%FC", "%FD", "%FE", "%FF",
 ];
+
+