From f6985f38f3c76a9be962f404f127b7222a9b5fff Mon Sep 17 00:00:00 2001 From: overtrue Date: Thu, 22 Oct 2020 18:28:58 +0800 Subject: [PATCH] Fixed #13 --- src/CosAdapter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CosAdapter.php b/src/CosAdapter.php index 2702519..60aaf1d 100644 --- a/src/CosAdapter.php +++ b/src/CosAdapter.php @@ -149,7 +149,7 @@ public function write($path, $contents, Config $config) { $options = $this->getUploadOptions($config); - return $this->getClient()->upload($this->getBucket(), $path, $contents, $options); + return $this->getClient()->upload($this->getBucket(), $path, $contents, $options['params']); } /** @@ -167,7 +167,7 @@ public function writeStream($path, $resource, Config $config) $this->getBucket(), $path, stream_get_contents($resource, -1, 0), - $options + $options['params'] ); } @@ -529,10 +529,10 @@ protected function listObjects($directory = '', $recursive = false) */ protected function getUploadOptions(Config $config) { - $options = []; + $options = ['params' => []]; if ($config->has('params')) { - $options['params'] = $config->get('params'); + $options['params'] = (array) $config->get('params'); } if ($config->has('visibility')) {