Issue #4964 has been reported by ren li. ---------------------------------------- Bug #4964: open-uri failed to handle multiple "Set-Cookie" headers http://redmine.ruby-lang.org/issues/4964 Author: ren li Status: Open Priority: Normal Assignee: Category: Target version: 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
on 2011-07-02 11:42
on 2011-07-02 12:32
Issue #4964 has been updated by Yui NARUSE. Category set to lib Status changed from Open to Assigned Assignee set to Akira Tanaka Target version set to 1.9.3 See also http://tools.ietf.org/html/rfc6265 ---------------------------------------- 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.3 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
on 2011-07-28 16:15
Issue #4964 has been updated by Hiroshi Nakamura. As the original reporter said. Akr, we should use resp.to_hash instead of resp.each to avoid HTTP header concatenation. It would introduce meta values incompatibility (String -> Array of String) so I propose to change the target version to '1.9.4'. ---------------------------------------- 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.3 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
on 2011-08-02 15:33
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
on 2013-01-20 05:40
Issue #4964 has been updated by zzak (Zachary Scott). This seems like feature, should move it to next minor or major? ---------------------------------------- Bug #4964: open-uri failed to handle multiple "Set-Cookie" headers https://bugs.ruby-lang.org/issues/4964#change-35491 Author: tdsparrow (ren li) Status: Assigned Priority: Normal Assignee: akr (Akira Tanaka) Category: lib Target version: 2.0.0 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
on 2013-01-23 09:47
Issue #4964 has been updated by naruse (Yui NARUSE). Target version changed from 2.0.0 to next minor ---------------------------------------- Bug #4964: open-uri failed to handle multiple "Set-Cookie" headers https://bugs.ruby-lang.org/issues/4964#change-35543 Author: tdsparrow (ren li) Status: Assigned Priority: Normal Assignee: akr (Akira Tanaka) Category: lib Target version: next minor 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
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.