mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
remove file exists check from cacheAndReturnMimeType
the method is only called if the file exists already a check against storing the fallback mimetype is added as a safety instead Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
c5a8246742
commit
83cc8202b8
1 changed files with 2 additions and 2 deletions
|
|
@ -77,7 +77,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
|
|||
}
|
||||
|
||||
/**
|
||||
* The mimetype is only cached if the file exists. Otherwise files access
|
||||
* The mimetype is only cached if the file has a valid mimetype. Otherwise files access
|
||||
* control will cache "application/octet-stream" for all the target node on:
|
||||
* rename, move, copy and all other methods which create a new item
|
||||
*
|
||||
|
|
@ -92,7 +92,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
|
|||
* @return string
|
||||
*/
|
||||
protected function cacheAndReturnMimeType(string $storageId, ?string $path, string $mimeType): string {
|
||||
if ($path !== null && $this->storage->file_exists($path)) {
|
||||
if ($path !== null && $mimeType !== 'application/octet-stream') {
|
||||
$this->mimeType[$storageId][$path] = $mimeType;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue