Accept new "MediaWiki-ChronologyClientId" HTTP header
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 19 Apr 2019 21:58:34 +0000 (14:58 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 20 Apr 2019 03:15:31 +0000 (20:15 -0700)
This is not used when the ID is already in "cpPosIndex".

Also, prefix the "ChronologyProtection" header with "MediaWiki-".
The header is currently usused but might be useful for services
in the future.

Bug: T212550
Change-Id: Ia871e95966d3550bac3dc4b2edb58e18359af7d9

includes/Setup.php

index bcdc1d5..bf363ab 100644 (file)
@@ -736,9 +736,10 @@ $cpPosInfo = LBFactory::getCPInfoFromCookieValue(
 MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [
        'IPAddress' => $wgRequest->getIP(),
        'UserAgent' => $wgRequest->getHeader( 'User-Agent' ),
-       'ChronologyProtection' => $wgRequest->getHeader( 'ChronologyProtection' ),
+       'ChronologyProtection' => $wgRequest->getHeader( 'MediaWiki-ChronologyProtection' ),
        'ChronologyPositionIndex' => $wgRequest->getInt( 'cpPosIndex', $cpPosInfo['index'] ),
        'ChronologyClientId' => $cpPosInfo['clientId']
+               ?? $wgRequest->getHeader( 'MediaWiki-ChronologyClientId' )
 ] );
 unset( $cpPosInfo );
 // Make sure that object caching does not undermine the ChronologyProtector improvements