Class: Tailog::RequestId
- Inherits:
-
Object
- Object
- Tailog::RequestId
- Defined in:
- lib/tailog/request_id.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequestId
constructor
A new instance of RequestId.
Constructor Details
#initialize(app) ⇒ RequestId
Returns a new instance of RequestId.
3 4 5 |
# File 'lib/tailog/request_id.rb', line 3 def initialize app @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/tailog/request_id.rb', line 7 def call env Tailog.request_id = external_request_id(env) || internal_request_id @app.call(env).tap do |_status, headers, _body| headers["X-Request-Id"] = Tailog.request_id end end |