Tap, tap goes the middleware

This commit is contained in:
Jeremy Kemper 2012-02-29 18:43:49 -07:00
parent f9995ce0e0
commit ceb66b6126
1 changed files with 1 additions and 4 deletions

View File

@ -19,10 +19,7 @@ module ActionDispatch
def call(env) def call(env)
env["action_dispatch.request_id"] = external_request_id(env) || internal_request_id env["action_dispatch.request_id"] = external_request_id(env) || internal_request_id
status, headers, body = @app.call(env) @app.call(env).tap { |status, headers, body| headers["X-Request-Id"] = env["action_dispatch.request_id"] }
headers["X-Request-Id"] = env["action_dispatch.request_id"]
[ status, headers, body ]
end end
private private