Accept new "MediaWiki-ChronologyClientId" HTTP header

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
This commit is contained in:
Aaron Schulz 2019-04-19 14:58:34 -07:00
parent 61702397aa
commit 6b6997dcf9

View 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