Backport #7997
closed
undefined method `unescape' for CGI:Class
Added by nelsnelson (Nels Nelson) about 11 years ago.
Updated about 11 years ago.
Description
$ ruby2.0 -v ./test.rb "_my_app_session_id=e6fafc122f84c2755310d712e5a19320; domain=.my.app.unknown.com; path=/; HttpOnly"
ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin12.2.0]
Parsing cookie string: _my_app_session_id=e6fafc122f84c2755310d712e5a19320; domain=.my.app.unknown.com; path=/; HttpOnly
/usr/local/lib/ruby/2.0.0/cgi/cookie.rb:151:in block in parse': undefined method
unescape' for CGI:Class (NoMethodError)
from /usr/local/lib/ruby/2.0.0/cgi/cookie.rb:148:in each' from /usr/local/lib/ruby/2.0.0/cgi/cookie.rb:148:in
parse'
from ./test.rb:7:in `'
Files
test.rb (140 Bytes)
test.rb |
Source code for demonstration example |
nelsnelson (Nels Nelson), 03/02/2013 03:21 AM
|
|
CGI cookie needs CGI/core to run...
open "lib/ruby/2.0.0/cgi.rb" and see that cgi/cookie is loaded after cgi/core
I think it's not an error, 'cgi/cookie' depends on 'cgi/core'.
No. I tried that, and the same error occurs, despite including the
require 'cgi/core'
line before the "require 'cgi/cookie'" line.
Please test and confirm your suggestions and include source code when suggesting contrarian points of view. Thank you for your assistance!
- Tracker changed from Backport to Bug
- Project changed from Backport200 to Ruby master
The project "Backport 200" is for backport tickets.
I'll move this ticket to "ruby-trunk".
Thanks.
A work around is to require 'cgi/util'
which is where CGI::unescape is defined and causes the test script provided to work perfectly.
- Assignee set to xibbar (Takeyuki FUJIOKA)
- ruby -v set to -
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r40362.
Nels, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- lib/cgi/cookie.rb(CGI::Cookie.parse): add require
for standalone require 'cgi/cookie' .[Bug #7997]
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport200
- Status changed from Closed to Assigned
- Assignee changed from xibbar (Takeyuki FUJIOKA) to nagachika (Tomoyuki Chikanaga)
- Status changed from Assigned to Closed
This issue was solved with changeset r40389.
Nels, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 40362: [Backport #7997]
* lib/cgi/cookie.rb(CGI::Cookie.parse): add require
for standalone require 'cgi/cookie' .[Bug #7997]
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0