handle long etags from dav external storage

we can only store etags up to 40 characters long in the database, so when we get an etag that's longer we simply hash it to bring down the length

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-03-14 14:46:39 +01:00
parent 762a8bb3d9
commit 631ae17dce
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -726,7 +726,11 @@ class DAV extends Common {
return null;
}
if (isset($response['{DAV:}getetag'])) {
return trim($response['{DAV:}getetag'], '"');
$etag = trim($response['{DAV:}getetag'], '"');
if (strlen($etag) > 40) {
$etag = md5($etag);
}
return $etag;
}
return parent::getEtag($path);
}