Skip to content
This repository
Browse code

Deprecate ActionController::Response#set_cookie :http_only option inf…

…avor of :httponly
  • Loading branch information...
commit 0edb0a4facdf6de8d12a004b59232e1006b93cd9 1 parent 3c625d6
Joshua Peek josh authored
2  actionpack/lib/action_controller/cookies.rb
@@ -41,7 +41,7 @@ module ActionController #:nodoc:
41 41 # * <tt>:expires</tt> - The time at which this cookie expires, as a Time object.
42 42 # * <tt>:secure</tt> - Whether this cookie is a only transmitted to HTTPS servers.
43 43 # Default is +false+.
44   - # * <tt>:http_only</tt> - Whether this cookie is accessible via scripting or
  44 + # * <tt>:httponly</tt> - Whether this cookie is accessible via scripting or
45 45 # only HTTP. Defaults to +false+.
46 46 module Cookies
47 47 def self.included(base)
3  actionpack/lib/action_controller/response.rb
@@ -169,6 +169,9 @@ def write(str)
169 169
170 170 def set_cookie(key, value)
171 171 if value.has_key?(:http_only)
  172 + ActiveSupport::Deprecation.warn(
  173 + "The :http_only option in ActionController::Response#set_cookie " +
  174 + "has been renamed. Please use :httponly instead.", caller)
172 175 value[:httponly] ||= value.delete(:http_only)
173 176 end
174 177
2  actionpack/test/controller/cookie_test.rb
@@ -33,7 +33,7 @@ def delete_cookie_with_path

0 comments on commit 0edb0a4

Please sign in to comment.
Something went wrong with that request. Please try again.