diff --git a/lib/middleware/request_tracker.rb b/lib/middleware/request_tracker.rb index a9d3a5b4ef3..af196dd3095 100644 --- a/lib/middleware/request_tracker.rb +++ b/lib/middleware/request_tracker.rb @@ -78,7 +78,9 @@ class Middleware::RequestTracker host = RailsMultisite::ConnectionManagement.host(env) if data - result[1]["X-Discourse-TrackView"] = 1 if data[:track_view] + if result && (headers=result[1]) + headers["X-Discourse-TrackView"] = 1 if data[:track_view] + end log_later(data,host) end