Class: Faraday::MsHeaderTrail
- Inherits:
-
Middleware
- Object
- Middleware
- Faraday::MsHeaderTrail
- Defined in:
- lib/faraday/ms_header_trail.rb
Overview
Public: Faraday middleware that stores audit data local thread into http header request
Examples
Faraday.new(configuration.host) do |builder|
builder.use Faraday::MsHeaderTrail
Constant Summary collapse
- RESPONSE_HEADER_PREFIX =
"X-"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = nil) ⇒ MsHeaderTrail
constructor
A new instance of MsHeaderTrail.
Constructor Details
#initialize(app, options = nil) ⇒ MsHeaderTrail
Returns a new instance of MsHeaderTrail.
18 19 20 21 |
# File 'lib/faraday/ms_header_trail.rb', line 18 def initialize(app, = nil) super @app = app end |
Instance Method Details
#call(env) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/faraday/ms_header_trail.rb', line 23 def call(env) ::MsHeaderTrail.retrieve.each_pair do |key, value| set_header(env, key, value) end @app.call(env) end |