Skip to content

Commit f4151eb

Browse files
committed
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 <opensource@fthiessen.de>
1 parent 5acf387 commit f4151eb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/dav/lib/Connector/Sabre/AddExtraHeadersPlugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ private function afterPut(RequestInterface $request, ResponseInterface $response
4040
return;
4141
}
4242

43+
// skip setting the headers if the PUT request failed
44+
if ($response->getStatus() >= 400) {
45+
return;
46+
}
47+
4348
$node = null;
4449
try {
4550
$node = $this->server->tree->getNodeForPath($request->getPath());

0 commit comments

Comments
 (0)