mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
fix(files): Never return a null ETag in DAV
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
a2cfcf3ca7
commit
70fa51f042
3 changed files with 3 additions and 10 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue