Class: Shaf::Middleware::RequestId

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RequestId

Returns a new instance of RequestId.



8
9
10
# File 'lib/shaf/middleware/request_id.rb', line 8

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
# File 'lib/shaf/middleware/request_id.rb', line 12

def call(env)
  env['REQUEST_ID'] = SecureRandom.uuid
  @app.call(env)
end