Class: ZuoraConnect::RequestIdMiddleware

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RequestIdMiddleware

Returns a new instance of RequestIdMiddleware.



6
7
8
# File 'lib/middleware/request_id_middleware.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
# File 'lib/middleware/request_id_middleware.rb', line 10

def call(env)
  self.request_id = env['action_dispatch.request_id']
  self.zuora_request_id = env["HTTP_ZUORA_REQUEST_ID"]
  env['CONTENT_TYPE'] = 'application/json' if env['HTTP_X_AMZ_SNS_MESSAGE_TYPE'].present?
  @app.call(env)
end