Skip to content

Commit

Permalink
Merge pull request #47971 from nextcloud/fix/do-not-try-to-change-res…
Browse files Browse the repository at this point in the history
…ponse-code-too-late

fix: Do not try to set HTTP response code on already closed connection
  • Loading branch information
come-nc authored Sep 14, 2024
2 parents 9bfbbd9 + e54eef5 commit 6c46c43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/legacy/OC_Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ public static function get($dir, $files, $params = null) {
} catch (\OCP\Files\ConnectionLostException $ex) {
self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
OC::$server->getLogger()->logException($ex, ['level' => \OCP\ILogger::DEBUG]);
\OC_Template::printErrorPage('Connection lost', $ex->getMessage(), 200);
/* We do not print anything here, the connection is already closed */
die();
} catch (\Exception $ex) {
self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
OC::$server->getLogger()->logException($ex);
Expand Down

0 comments on commit 6c46c43

Please sign in to comment.