diff options
author | Robin Appelman <robin@icewind.nl> | 2019-03-14 14:46:39 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-03-14 14:46:39 +0100 |
commit | 631ae17dce8335d8cdb4669060cd828efe6b294d (patch) | |
tree | 594cf78c3a9cae14ab67275efc2f9b9ed40b6fad /lib/private | |
parent | 762a8bb3d9521a9f75d9e186150cb77241b3bc19 (diff) | |
download | nextcloud-server-631ae17dce8335d8cdb4669060cd828efe6b294d.tar.gz nextcloud-server-631ae17dce8335d8cdb4669060cd828efe6b294d.zip |
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>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Storage/DAV.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index abb76660ca8..52ed8900569 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -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); } |