Backport #7997

undefined method `unescape' for CGI:Class

Added by Nels Nelson about 1 year ago. Updated 12 months ago.

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

Description

$ ruby2.0 -v ./test.rb "myappsessionid=e6fafc122f84c2755310d712e5a19320; domain=.my.app.unknown.com; path=/; HttpOnly"
ruby 2.0.0dev (2013-02-08 trunk 39161) [x8664-darwin12.2.0]
Parsing cookie string: _my
appsessionid=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 40389
Added by Tomoyuki Chikanaga 12 months 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 1 year ago

#2 Updated by Marco Carvalho about 1 year 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 1 year 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 1 year 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 1 year 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 12 months ago

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

#7 Updated by Takeyuki FUJIOKA 12 months 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 12 months 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 12 months 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