You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// note the `token` implementation excludes disallowed ASCII ranges
145
+
// and disallowed delimiters: https://datatracker.ietf.org/doc/html/rfc9110#section-5.6.2
146
+
// though it does not forbid `obs-text`: %x80-FF
145
147
staticRE_CACHE_DIRECTIVE:Lazy<Regex> =
146
-
// unicode support disabled, allow ; or , delimiter | capture groups: 1: directive = 2: token OR quoted-string
148
+
// to break our version down further:
149
+
// `(?-u)`: unicode support disabled, which puts the regex into "ASCII compatible mode" for specifying literal bytes like \x7F: https://docs.rs/regex/1.10.4/regex/bytes/index.html#syntax
150
+
// `(?:^|(?:\s*[,;]\s*)`: allow either , or ; as a delimiter
151
+
// `([^\x00-\x20\(\)<>@,;:\\"/\[\]\?=\{\}\x7F]+)`: token (directive name capture group)
152
+
// `(?:=((?:[^\x00-\x20\(\)<>@,;:\\"/\[\]\?=\{\}\x7F]+|(?:"(?:[^"\\]|\\.)*"))))`: token OR quoted-string (directive value capture-group)
0 commit comments