diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-13 02:29:47 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-13 02:29:47 +0000 |
commit | 0cde80d36a498655f3a6cdc792130e7f39fbe776 (patch) | |
tree | b17783b694c3f99eefec78468e6447a502e0c8d0 /lib/open-uri.rb | |
parent | a8998030fbabc0f604f82350a0767002a86f6068 (diff) |
* lib/open-uri.rb (OpenURI::Meta#content_type_parse): strip quotes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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] |