Skip to content

Commit 6828146

Browse files
committed
Merge #251 No session on DAV API call
2 parents b463077 + 70f1b3b commit 6828146

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

lib/base.php

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

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

0 commit comments

Comments
 (0)