Skip to content

Commit 3ad3bd3

Browse files
come-ncbackportbot-nextcloud[bot]
authored andcommitted
Do not output a warning when a file is not found
This would spam log with warnings from Desktop client doing HEAD on non-existing path to test them. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent e337551 commit 3ad3bd3

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

apps/dav/lib/DAV/ViewOnlyPlugin.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
2525
use OCA\DAV\Connector\Sabre\File as DavFile;
26-
use OCA\DAV\Meta\MetaFile;
27-
use OCP\Files\FileInfo;
2826
use OCP\Files\NotFoundException;
2927
use Psr\Log\LoggerInterface;
3028
use Sabre\DAV\Server;
@@ -36,7 +34,6 @@
3634
* Sabre plugin for restricting file share receiver download:
3735
*/
3836
class ViewOnlyPlugin extends ServerPlugin {
39-
4037
private ?Server $server = null;
4138
private LoggerInterface $logger;
4239

@@ -99,9 +96,7 @@ public function checkViewOnly(RequestInterface $request): bool {
9996
throw new Forbidden('Access to this resource has been denied because it is in view-only mode.');
10097
}
10198
} catch (NotFound $e) {
102-
$this->logger->warning($e->getMessage(), [
103-
'exception' => $e,
104-
]);
99+
// File not found
105100
}
106101

107102
return true;

0 commit comments

Comments
 (0)