Backport #7997

undefined method `unescape' for CGI:Class

Added by Nels Nelson about 2 years ago. Updated almost 2 years ago.

[ruby-core:53081]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

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 methodunescape' 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 `'

test.rb Magnifier - Source code for demonstration example (140 Bytes) Nels Nelson, 03/02/2013 03:21 AM

Associated revisions

Revision 40362
Added by Takeyuki FUJIOKA almost 2 years ago

  • lib/cgi/cookie.rb(CGI::Cookie.parse): add require for standalone require 'cgi/cookie' .[Bug #7997]

Revision 40389
Added by Tomoyuki Chikanaga almost 2 years ago

merge revision(s) 40362: [Backport #7997]

* lib/cgi/cookie.rb(CGI::Cookie.parse): add require

for standalone require 'cgi/cookie' .[Bug #7997]

History

#1 Updated by Nels Nelson about 2 years ago

#2 Updated by Marco Carvalho about 2 years ago

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'.

#3 Updated by Nels Nelson about 2 years ago

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!

#4 Updated by Tomoyuki Chikanaga about 2 years ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to Ruby trunk

The project "Backport 200" is for backport tickets.
I'll move this ticket to "ruby-trunk".

Thanks.

#5 Updated by Daniel Evans about 2 years ago

A work around is to require 'cgi/util' which is where CGI::unescape is defined and causes the test script provided to work perfectly.

#6 Updated by Charlie Somerville about 2 years ago

  • ruby -v set to -
  • Assignee set to Takeyuki FUJIOKA

#7 Updated by Takeyuki FUJIOKA almost 2 years ago

  • 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]

#8 Updated by Tomoyuki Chikanaga almost 2 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Status changed from Closed to Assigned
  • Assignee changed from Takeyuki FUJIOKA to Tomoyuki Chikanaga

#9 Updated by Tomoyuki Chikanaga almost 2 years ago

  • 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