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
# Unquote a "quoted-string" value according to <https://tools.ietf.org/html/rfc7230#section-3.2.6>. It should already match the QUOTED_STRING pattern above by the parser.
19
+
defself.unquote(value,normalize_whitespace=true)
20
+
value=value[1...-1]
21
+
22
+
value.gsub!(/\\(.)/,'\1')
23
+
24
+
ifnormalize_whitespace
25
+
# LWS = [CRLF] 1*( SP | HT )
26
+
value.gsub!(/[\r\n]+\s+/," ")
27
+
end
28
+
29
+
returnvalue
30
+
end
31
+
32
+
QUOTES_REQUIRED=/[()<>@,;:\\"\/\[\]?={} \t]/
33
+
34
+
# Quote a string for HTTP header values if required.
35
+
#
36
+
# @raises [ArgumentError] if the value contains invalid characters like control characters or newlines.
0 commit comments