Skip to content

Commit

Permalink
fix(status): Avoid session creation for status requests
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf committed Nov 21, 2024
1 parent 3822db5 commit 7395bfd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,13 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
public static function initSession(): void {
$request = Server::get(IRequest::class);

// Do not initialize sessions for 'status.php' requests
// Monitoring endpoints can quickly flood session handlers
// and 'status.php' doesn't require sessions anyway
if (str_ends_with($request->getRequestUri(), '/status.php')) {
return;
}

// TODO: Temporary disabled again to solve issues with CalDAV/CardDAV clients like DAVx5 that use cookies
// TODO: See https://github.com/nextcloud/server/issues/37277#issuecomment-1476366147 and the other comments
// TODO: for further information.
Expand Down Expand Up @@ -790,7 +797,7 @@ public static function init(): void {
$isScssRequest = true;
}

if (substr($request->getRequestUri(), -11) === '/status.php') {
if (str_ends_with($request->getRequestUri(), '/status.php')) {
http_response_code(400);
header('Content-Type: application/json');
echo '{"error": "Trusted domain error.", "code": 15}';
Expand Down

0 comments on commit 7395bfd

Please sign in to comment.