mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
DEV: Include message-bus request type in HTTP request data (#19762)
This commit is contained in:
@ -125,13 +125,26 @@ class Middleware::RequestTracker
|
||||
is_api: is_api,
|
||||
is_user_api: is_user_api,
|
||||
is_background: is_message_bus || is_topic_timings,
|
||||
background_type: is_message_bus ? "message-bus" : "topic-timings",
|
||||
is_mobile: helper.is_mobile?,
|
||||
track_view: track_view,
|
||||
timing: timing,
|
||||
queue_seconds: env['REQUEST_QUEUE_SECONDS']
|
||||
}
|
||||
|
||||
if h[:is_background]
|
||||
h[:background_type] = if is_message_bus
|
||||
if request.query_string.include?("dlp=t")
|
||||
"message-bus-dlp"
|
||||
elsif env["HTTP_DONT_CHUNK"]
|
||||
"message-bus-dontchunk"
|
||||
else
|
||||
"message-bus"
|
||||
end
|
||||
else
|
||||
"topic-timings"
|
||||
end
|
||||
end
|
||||
|
||||
if h[:is_crawler]
|
||||
user_agent = env['HTTP_USER_AGENT']
|
||||
if user_agent && (user_agent.encoding != Encoding::UTF_8)
|
||||
|
Reference in New Issue
Block a user