diff --git a/lib/hijack.rb b/lib/hijack.rb index 74efe769789..a8a1268fb1d 100644 --- a/lib/hijack.rb +++ b/lib/hijack.rb @@ -89,7 +89,7 @@ module Hijack io.close if io rescue nil if request_tracker - status = instance.status rescue 500 + status = response.status rescue 500 request_tracker.log_request_info(env, [status, headers || {}, []], timings) end end diff --git a/lib/middleware/request_tracker.rb b/lib/middleware/request_tracker.rb index 052b665bc4d..e544e55516b 100644 --- a/lib/middleware/request_tracker.rb +++ b/lib/middleware/request_tracker.rb @@ -97,7 +97,7 @@ class Middleware::RequestTracker status: status, is_crawler: helper.is_crawler?, has_auth_cookie: helper.has_auth_cookie?, - is_background: request.path =~ /^\/message-bus\// || request.path == /\/topics\/timings/, + is_background: !!(request.path =~ /^\/message-bus\// || request.path =~ /\/topics\/timings/), is_mobile: helper.is_mobile?, track_view: track_view, timing: timing