diff options
Diffstat (limited to 'lib/open-uri.rb')
-rw-r--r-- | lib/open-uri.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb index b426455e27..406a388e5b 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -465,7 +465,9 @@ module OpenURI subtype = $2.downcase parameters = [] $3.scan(/;#{RE_LWS}?(#{RE_TOKEN})#{RE_LWS}?=#{RE_LWS}?(?:(#{RE_TOKEN})|(#{RE_QUOTED_STRING}))/no) {|att, val, qval| - val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } if qval + if qval + val = qval[1...-1].gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } + end parameters << [att.downcase, val] } ["#{type}/#{subtype}", *parameters] |