mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
db44fd4d75
commit
1f7edc0259
2 changed files with 7 additions and 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.
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue