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 | 1f7edc0259c6c4e4b15ebfc7b10599d2fec27ff5 (patch) | |
| tree | 26d3dec469a3dbd3a2b661ca263c0691ee49e67c | |
| parent | db44fd4d75d4f7ba40e154e3eec63d352aa0c4db (diff) | |
* lib/open-uri.rb (OpenURI::Meta#content_type_parse): strip quotes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | lib/open-uri.rb | 4 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Sun Sep 13 11:06:12 2009 Tanaka Akira <akr@fsij.org> + + * lib/open-uri.rb (OpenURI::Meta#content_type_parse): strip quotes. + Sun Sep 13 01:55:32 2009 Tanaka Akira <akr@fsij.org> * lib/open-uri.rb (URI::FTP#buffer_open): fix the %2F handling. diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 73f10b356c..69982ec70c 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -435,7 +435,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] |
