From f4151eb052472eedb67066869537741dfcb8df3c Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 31 Mar 2026 12:29:38 +0200 Subject: [PATCH] fix(dav): `AddExtraHeadersPlugin` should not be handled on error When a request failed (failed upload) the file is not created, thus this will spam the log with "cannot set extra headers" error. To reproduce use e.g. files_antivirus with eicar test files. Signed-off-by: Ferdinand Thiessen --- apps/dav/lib/Connector/Sabre/AddExtraHeadersPlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/dav/lib/Connector/Sabre/AddExtraHeadersPlugin.php b/apps/dav/lib/Connector/Sabre/AddExtraHeadersPlugin.php index e728c3f83b7d7..e31ba26bd954b 100644 --- a/apps/dav/lib/Connector/Sabre/AddExtraHeadersPlugin.php +++ b/apps/dav/lib/Connector/Sabre/AddExtraHeadersPlugin.php @@ -40,6 +40,11 @@ private function afterPut(RequestInterface $request, ResponseInterface $response return; } + // skip setting the headers if the PUT request failed + if ($response->getStatus() >= 400) { + return; + } + $node = null; try { $node = $this->server->tree->getNodeForPath($request->getPath());