diff options
author | Andrew White <andrew.white@unboxedconsulting.com> | 2016-02-16 05:58:28 +0000 |
---|---|---|
committer | Andrew White <andrew.white@unboxedconsulting.com> | 2016-02-16 05:58:28 +0000 |
commit | 4247f02688e20af183f75b943b2444b66979198f (patch) | |
tree | f6716210b59d0f48bb368ecde683daef12ebe465 /actionpack/lib | |
parent | 7a0f784af01421161593994d4c5ec3ff6e818cc2 (diff) | |
download | rails-4247f02688e20af183f75b943b2444b66979198f.tar.gz rails-4247f02688e20af183f75b943b2444b66979198f.tar.bz2 rails-4247f02688e20af183f75b943b2444b66979198f.zip |
Add require and move escape to private method
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index 601b55cb8f..83ea7722c2 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -2,6 +2,7 @@ require 'active_support/core_ext/hash/keys' require 'active_support/key_generator' require 'active_support/message_verifier' require 'active_support/json' +require 'rack/utils' module ActionDispatch class Request @@ -337,7 +338,7 @@ module ActionDispatch end def to_header - @cookies.map { |k,v| "#{::Rack::Utils.escape(k)}=#{::Rack::Utils.escape(v)}" }.join ';' + @cookies.map { |k,v| "#{escape(k)}=#{escape(v)}" }.join ';' end def handle_options(options) #:nodoc: @@ -419,6 +420,10 @@ module ActionDispatch private + def escape(string) + ::Rack::Utils.escape(string) + end + def make_set_cookie_header(header) header = @set_cookies.inject(header) { |m, (k, v)| if write_cookie?(v) |