Class: Simplewoo::Connection::TrustedAppMiddleware
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Simplewoo::Connection::TrustedAppMiddleware
- Defined in:
- lib/simplewoo/connection.rb
Overview
Middleware for inserting the trusted header into requests
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ TrustedAppMiddleware
constructor
A new instance of TrustedAppMiddleware.
Constructor Details
#initialize(app, options = {}) ⇒ TrustedAppMiddleware
Returns a new instance of TrustedAppMiddleware.
57 58 59 60 |
# File 'lib/simplewoo/connection.rb', line 57 def initialize(app, = {}) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
62 63 64 65 |
# File 'lib/simplewoo/connection.rb', line 62 def call(env) env[:request_headers]["Woofound-Use-Trusted-Auth"] = @options[:trusted].to_s @app.call(env) end |