Merge pull request #47837 from nextcloud/fix/files/dav-etag

This commit is contained in:
Kate 2024-09-09 11:04:08 +02:00 committed by GitHub
commit 0f732199d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 10 deletions

View file

@ -391,7 +391,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
* get the ETag for a file or folder
*
* @param string $path
* @return string
* @return string|false
*/
public function getETag($path) {
return uniqid();

View file

@ -721,10 +721,9 @@ class DAV extends Common {
return $stat ? $stat['permissions'] : 0;
}
/** {@inheritdoc} */
public function getETag($path) {
$meta = $this->getMetaData($path);
return $meta ? $meta['etag'] : null;
return $meta ? $meta['etag'] : false;
}
/**

View file

@ -513,17 +513,11 @@ class Local extends \OC\Files\Storage\Common {
return true;
}
/**
* get the ETag for a file or folder
*
* @param string $path
* @return string
*/
public function getETag($path) {
return $this->calculateEtag($path, $this->stat($path));
}
private function calculateEtag(string $path, array $stat): string {
private function calculateEtag(string $path, array $stat): string|false {
if ($stat['mode'] & 0x4000 && !($stat['mode'] & 0x8000)) { // is_dir & not socket
return parent::getETag($path);
} else {