mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(s3): Fix 0 folder handling in External Storage
Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
parent
62f4a7eb80
commit
9630fd0b60
1 changed files with 8 additions and 8 deletions
|
|
@ -32,26 +32,21 @@ class AmazonS3 extends Common {
|
|||
|
||||
private LoggerInterface $logger;
|
||||
|
||||
public function needsPartFile(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var CappedMemoryCache<array|false> */
|
||||
private CappedMemoryCache $objectCache;
|
||||
|
||||
/** @var CappedMemoryCache<bool> */
|
||||
private CappedMemoryCache $directoryCache;
|
||||
|
||||
/** @var CappedMemoryCache<array> */
|
||||
private CappedMemoryCache $filesCache;
|
||||
|
||||
private IMimeTypeDetector $mimeDetector;
|
||||
private ?bool $versioningEnabled = null;
|
||||
private ICache $memCache;
|
||||
private ?bool $versioningEnabled = null;
|
||||
|
||||
public function __construct(array $parameters) {
|
||||
parent::__construct($parameters);
|
||||
$this->parseParams($parameters);
|
||||
// @todo: using `key` here may be problematic with different authentication methods and/or key rotation...
|
||||
$this->id = 'amazon::external::' . md5($this->params['hostname'] . ':' . $this->params['bucket'] . ':' . $this->params['key']);
|
||||
$this->objectCache = new CappedMemoryCache();
|
||||
$this->directoryCache = new CappedMemoryCache();
|
||||
|
|
@ -66,7 +61,7 @@ class AmazonS3 extends Common {
|
|||
private function normalizePath(string $path): string {
|
||||
$path = trim($path, '/');
|
||||
|
||||
if (!$path) {
|
||||
if ($path === '') {
|
||||
$path = '.';
|
||||
}
|
||||
|
||||
|
|
@ -742,6 +737,11 @@ class AmazonS3 extends Common {
|
|||
}
|
||||
}
|
||||
|
||||
public function needsPartFile(): bool {
|
||||
// handled natively by the S3 backend/client integration
|
||||
return false;
|
||||
}
|
||||
|
||||
public function writeStream(string $path, $stream, ?int $size = null): int {
|
||||
if ($size === null) {
|
||||
$size = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue