From: Akira Tanaka Date: 2011-08-02T22:31:31+09:00 Subject: [ruby-core:38719] [Ruby 1.9 - Bug #4964] open-uri failed to handle multiple "Set-Cookie" headers Issue #4964 has been updated by Akira Tanaka. Target version changed from 1.9.3 to 1.9.x I think we can fix the problem without incompatibility. (new method to return array of field bodies for a field name.) It needs new feature, though. ---------------------------------------- Bug #4964: open-uri failed to handle multiple "Set-Cookie" headers http://redmine.ruby-lang.org/issues/4964 Author: ren li Status: Assigned Priority: Normal Assignee: Akira Tanaka Category: lib Target version: 1.9.x ruby -v: ruby 1.9.2p174 (2011-01-28 revision 30696) [i686-linux] =begin == Problem open-uri handle multiple "Set-Cookie" headers in a wrong way. Given a header from http server like: Set-Cookie: name1=value1; blabla Set-Cookie: name2=value2; blabla open-uri will pack it into meta info of result like: Set-Cookie: name1=value; blabla, name2=value2; blabla The problem is that line 332 of open-uri.rb resp.each {|name,value| buf.io.meta_add_field name, value } In turn will call invoke code in net/http.rb to join headers with ",". == ruby -v: ruby 1.9.2p174 (2011-01-28 revision 30696) [i686-linux] == code: require 'open-uri' begin open "http://douban.fm", :redirect => false rescue OpenURI::HTTPRedirect => redirect redirect.io.meta['set-cookie'] end =end -- http://redmine.ruby-lang.org