mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 16:45:10 +08:00
Previously, we didn't pass through the `X-Discourse-Trackview` and
`X-Discourse-Browserpageview` headers in the MessageBus `/poll`
response.
This is because MessageBus has a specific way of defining extra headers,
which we do in the `004-message_bus.rb` initializer.
We were adding the `X-Discourse-*` headers in `RequestTracker` after
`@app.call` was called, so the MessageBus middleware which is lower in
the
middleware stack would not have access to this data.
So in this commit, we hoist this data collection about the request
tracking above the `@app.call` line so it's acceessible in the
MessageBus middleware and we can add them to the response there. We
also move this data collection into a reusable method so we can call it
from before the env and also later when actually logging the request.
Followup
|
||
|---|---|---|
| .. | ||
| anonymous_cache_spec.rb | ||
| crawler_hooks_spec.rb | ||
| discourse_public_exceptions_spec.rb | ||
| enforce_hostname_spec.rb | ||
| request_tracker_spec.rb | ||