소스 검색

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>
Robin Appelman 5 년 전
부모
커밋
54b14946b4
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      lib/private/Files/Storage/DAV.php

+ 5 - 1
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);
 	}