correct tracking of x runtime

This commit is contained in:
Sam 2018-01-19 17:51:04 +11:00
parent 54dc191a91
commit 8bf91b8dca
1 changed files with 2 additions and 2 deletions

View File

@ -138,8 +138,8 @@ class Middleware::RequestTracker
result = @app.call(env)
info = MethodProfiler.stop
# possibly transferred?
if info
env["X-Runtime"] = "%0.6f" % info[:total_duration]
if info && (headers = result[1])
headers["X-Runtime"] = "%0.6f" % info[:total_duration]
end
result
ensure