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>
This commit is contained in:
Ferdinand Thiessen 2026-03-31 12:29:38 +02:00
parent 5acf3878f3
commit f4151eb052
No known key found for this signature in database
GPG key ID: 7E849AE05218500F

View file

@ -40,6 +40,11 @@ class AddExtraHeadersPlugin extends \Sabre\DAV\ServerPlugin {
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());