Class: Devise::CookieSanitizer
- Inherits:
-
Object
- Object
- Devise::CookieSanitizer
- Defined in:
- lib/devise/rails/warden_compat.rb
Overview
Solve a bug in Rails where Set-Cookie is returning an array.
Constant Summary collapse
- SET_COOKIE =
"Set-Cookie".freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ CookieSanitizer
constructor
A new instance of CookieSanitizer.
Constructor Details
#initialize(app) ⇒ CookieSanitizer
Returns a new instance of CookieSanitizer.
38 39 40 |
# File 'lib/devise/rails/warden_compat.rb', line 38 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/devise/rails/warden_compat.rb', line 42 def call(env) response = @app.call(env) headers = response[1] = headers[SET_COOKIE] if .respond_to?(:join) headers[SET_COOKIE] = .join("\n").squeeze("\n") end response end |