Class: VerbotenKeys::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/verboten_keys/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



5
6
7
# File 'lib/verboten_keys/middleware.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/verboten_keys/middleware.rb', line 9

def call(env)
  # Get the result of the request from the app.
  @status, @headers, @response = @app.call(env)

  # Perform all of our work here...
  remove_forbidden_keys

  # Let the app continue as-is.
  [@status, @headers, @response]
end