Skip to content
Snippets Groups Projects
Unverified Commit 9a8cef96 authored by Robin Appelman's avatar Robin Appelman
Browse files

add test for skipping cookie checks for ocs


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 8626ccab
No related branches found
No related tags found
No related merge requests found
......@@ -1787,6 +1787,31 @@ class RequestTest extends \Test\TestCase {
$this->assertFalse($request->passesLaxCookieCheck());
}
public function testSkipCookieCheckForOCSRequests() {
/** @var Request $request */
$request = $this->getMockBuilder('\OC\AppFramework\Http\Request')
->setMethods(['getScriptName'])
->setConstructorArgs([
[
'server' => [
'HTTP_REQUESTTOKEN' => 'AAAHGxsTCTc3BgMQESAcNR0OAR0=:MyTotalSecretShareds',
'HTTP_OCS_APIREQUEST' => 'true',
],
'cookies' => [
session_name() => 'asdf',
'nc_sameSiteCookiestrict' => 'false',
],
],
$this->secureRandom,
$this->config,
$this->csrfTokenManager,
$this->stream
])
->getMock();
$this->assertTrue($request->passesStrictCookieCheck());
}
/**
* @return array
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment