Class: SafeCookies::Middleware
- Inherits:
-
Object
- Object
- SafeCookies::Middleware
- Includes:
- CookiePathFix, Helpers
- Defined in:
- lib/safe_cookies.rb
Constant Summary collapse
- COOKIE_NAME_REGEX =
/(?=^|\n)[^\n;,=]+/i
Constants included from Helpers
Helpers::KNOWN_COOKIES_DIVIDER
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Methods included from Helpers
#cache_application_cookies_string, #cookies_have_been_rewritten_before?, #http_only, #known_cookie_names, #request_cookies, #rewritable_request_cookies, #secure, #set_cookie!, #should_be_http_only?, #should_be_secure?, #ssl?, #stored_application_cookie_names
Methods included from CookiePathFix
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
31 32 33 34 |
# File 'lib/safe_cookies.rb', line 31 def initialize(app) @app = app @config = SafeCookies.configuration or raise "Don't know what to do without configuration" end |
Instance Method Details
#call(env) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/safe_cookies.rb', line 36 def call(env) reset_instance_variables @request = Rack::Request.new(env) # call the next middleware up the stack status, @headers, body = @app.call(env) if unless [ status, @headers, body ] end |