Ticket #2194: less_copying_in_cookie_construction.patch
| File less_copying_in_cookie_construction.patch, 1.2 kB (added by skaes, 3 years ago) |
|---|
-
actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb
old new 71 71 # Convert the Cookie to its string representation. 72 72 def to_s 73 73 buf = "" 74 buf += @name +'='74 buf << @name << '=' 75 75 76 76 if @value.kind_of?(String) 77 buf +=CGI::escape(@value)77 buf << CGI::escape(@value) 78 78 else 79 buf +=@value.collect{|v| CGI::escape(v) }.join("&")79 buf << @value.collect{|v| CGI::escape(v) }.join("&") 80 80 end 81 81 82 82 if @domain 83 buf += '; domain=' +@domain83 buf << '; domain=' << @domain 84 84 end 85 85 86 86 if @path 87 buf += '; path=' +@path87 buf << '; path=' << @path 88 88 end 89 89 90 90 if @expires 91 buf += '; expires=' +CGI::rfc1123_date(@expires)91 buf << '; expires=' << CGI::rfc1123_date(@expires) 92 92 end 93 93 94 94 if @secure == true 95 buf +='; secure'95 buf << '; secure' 96 96 end 97 97 98 98 buf