Commit graph

6 commits

Author SHA1 Message Date
jenkins-bot
5499034af2 Merge "HeaderCallback: Sanitize cookie values in debug logs" 2020-07-03 03:28:53 +00:00
Gergő Tisza
faca43e3f7 Set X-Request-Id on all web responses
To make correlating MediaWiki logs and reverse proxy logs easier,
set the X-Request-Id header on responses. Ideally the header
would be set by the reverse proxy on the incoming request (see
e.g. T221976), but that is more complicated to set up consistently
and will be different for different MediaWiki setups; this patch
provides a simple fallback mechanism.

When the request itself had an X-Request-Id header (and
$wgAllowExternalReqID is set), this makes MediaWiki reflect that
header back; otherwise the value is a long random string.

Given that the header will be cached by reverse proxies, it is
not really a request ID (something unique to the request
that the header was sent in response to) as a "request group ID"
(shared by all requests which were served with the same cached
response), but we already had this semantic mismatch with the
wgRequestId JS variable, this patch just makes the ID easier
to log.

Bug: T201409
Change-Id: I9bca677b945ca3aa0e50d81bb468862efec54890
2020-06-30 16:55:47 +00:00
Gergő Tisza
96583fe903 HeaderCallback: Sanitize cookie values in debug logs
Avoid logging session cookies and other similar data, but leave
enough for correlating with other logs.

Change-Id: Ie2b622eb606605aed2b2fada1da040320bd27639
2020-06-28 22:17:28 +00:00
Reedy
aeea6c5520 Add some @since tags to HeaderCallback
Change-Id: I28053418d107f4a101aa7d8a2203c6864acd311f
2019-06-06 16:14:58 +01:00
Thiemo Kreuz
1aaa08bf37 Fix HeaderCallback failing on headers without a colon
Bug: T216086
Change-Id: I3007a5bc238a5271cc3fe4da1844ff74efd58be0
2019-02-19 18:25:14 +01:00
Tim Starling
f193271cff Log a backtrace from the culprit location if headers were already sent
Install the backtrace collector very early, so that we can get the
backtrace even if headers were sent from LocalSettings.php.

Bug: T157392
Change-Id: I9bc732b34481c95afb5362e135a87bd4302498e2
2017-02-23 14:10:12 +11:00