From 0cde80d36a498655f3a6cdc792130e7f39fbe776 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 13 Sep 2009 02:29:47 +0000 Subject: * 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 --- lib/open-uri.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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] -- cgit v1.2.3