*/
if(!$this->request->passesCSRFCheck() && !(
$controller instanceof OCSController &&
- $this->request->getHeader('OCS_APIREQUEST') === true)) {
+ $this->request->getHeader('OCS-APIREQUEST') === 'true')) {
throw new CrossSiteRequestForgeryException();
}
}
[$controller, true, true],
[$ocsController, false, true],
- [$ocsController, true, true],
+ [$ocsController, true, false],
];
}
public function testCsrfOcsController(Controller $controller, $hasOcsApiHeader, $exception) {
$this->request
->method('getHeader')
+ ->with('OCS-APIREQUEST')
->willReturn($hasOcsApiHeader ? 'true' : null);
$this->request->expects($this->once())
->method('passesStrictCookieCheck')