浏览代码

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>
tags/v25.0.0beta7
Côme Chilliet 1年前
父节点
当前提交
b5ccece5a9
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入6 次删除
  1. 1
    6
      apps/dav/lib/DAV/ViewOnlyPlugin.php

+ 1
- 6
apps/dav/lib/DAV/ViewOnlyPlugin.php 查看文件

@@ -23,8 +23,6 @@ namespace OCA\DAV\DAV;

use OCA\DAV\Connector\Sabre\Exception\Forbidden;
use OCA\DAV\Connector\Sabre\File as DavFile;
use OCA\DAV\Meta\MetaFile;
use OCP\Files\FileInfo;
use OCP\Files\NotFoundException;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Server;
@@ -36,7 +34,6 @@ use Sabre\DAV\Exception\NotFound;
* Sabre plugin for restricting file share receiver download:
*/
class ViewOnlyPlugin extends ServerPlugin {

private ?Server $server = null;
private LoggerInterface $logger;

@@ -99,9 +96,7 @@ class ViewOnlyPlugin extends ServerPlugin {
throw new Forbidden('Access to this resource has been denied because it is in view-only mode.');
}
} catch (NotFound $e) {
$this->logger->warning($e->getMessage(), [
'exception' => $e,
]);
// File not found
}

return true;

正在加载...
取消
保存