mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/cgi.rb (CGI::Cookie::initialize): performance patch from
Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a99d1475d
commit
0e97a7dbd0
2 changed files with 16 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Mar 14 16:35:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/cgi.rb (CGI::Cookie::initialize): performance patch from
|
||||||
|
Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048].
|
||||||
|
|
||||||
Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* configure.in (RUBY_LIB_PREFIX): use libdir.
|
* configure.in (RUBY_LIB_PREFIX): use libdir.
|
||||||
|
|
15
lib/cgi.rb
15
lib/cgi.rb
|
@ -792,11 +792,16 @@ class CGI
|
||||||
#
|
#
|
||||||
# These keywords correspond to attributes of the cookie object.
|
# These keywords correspond to attributes of the cookie object.
|
||||||
def initialize(name = "", *value)
|
def initialize(name = "", *value)
|
||||||
options = if name.kind_of?(String)
|
if name.kind_of?(String)
|
||||||
{ "name" => name, "value" => value }
|
@name = name
|
||||||
else
|
@value = value
|
||||||
name
|
%r|^(.*/)|.match(ENV["SCRIPT_NAME"])
|
||||||
|
@path = ($1 or "")
|
||||||
|
@secure = false
|
||||||
|
return super(@value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
options = name
|
||||||
unless options.has_key?("name")
|
unless options.has_key?("name")
|
||||||
raise ArgumentError, "`name' required"
|
raise ArgumentError, "`name' required"
|
||||||
end
|
end
|
||||||
|
@ -880,7 +885,7 @@ class CGI
|
||||||
if cookies.has_key?(name)
|
if cookies.has_key?(name)
|
||||||
values = cookies[name].value + values
|
values = cookies[name].value + values
|
||||||
end
|
end
|
||||||
cookies[name] = Cookie::new({ "name" => name, "value" => values })
|
cookies[name] = Cookie::new(name, *values)
|
||||||
end
|
end
|
||||||
|
|
||||||
cookies
|
cookies
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue