Skip to content

Commit 63f0bf0

Browse files
rhtotmemurats
authored andcommitted
Combine the check for API calls as from MagentaCLOUD prod and NC E2E test
1 parent 8d8be75 commit 63f0bf0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/base.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,14 @@ public static function initSession(): void {
371371
// TODO: Temporary disabled again to solve issues with CalDAV/CardDAV clients like DAVx5 that use cookies
372372
// TODO: See https://github.com/nextcloud/server/issues/37277#issuecomment-1476366147 and the other comments
373373
// TODO: for further information.
374-
// $isDavRequest = strpos($request->getRequestUri(), '/remote.php/dav') === 0 || strpos($request->getRequestUri(), '/remote.php/webdav') === 0;
375-
// if ($request->getHeader('Authorization') !== '' && is_null($request->getCookie('cookie_test')) && $isDavRequest && !isset($_COOKIE['nc_session_id'])) {
376-
// setcookie('cookie_test', 'test', time() + 3600);
377-
// // Do not initialize the session if a request is authenticated directly
378-
// // unless there is a session cookie already sent along
379-
// return;
380-
// }
374+
// MagentaCLOUD stays with original version of the solution from production
375+
$isDavRequest = strpos($request->getRequestUri(), '/remote.php/dav') === 0 ||
376+
strpos($request->getRequestUri(), '/remote.php/webdav') === 0;
377+
if ($request->getHeader('Authorization') !== '' && $isDavRequest && !isset($_COOKIE['nc_session_id'])) {
378+
// Do not initialize the session if a request is authenticated directly
379+
// unless there is a session cookie already sent along
380+
return;
381+
}
381382

382383
if ($request->getServerProtocol() === 'https') {
383384
ini_set('session.cookie_secure', 'true');

0 commit comments

Comments
 (0)