Skip to content

Commit

Permalink
Fixed #13
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Oct 22, 2020
1 parent ed9d563 commit f6985f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CosAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

/**
Expand All @@ -167,7 +167,7 @@ public function writeStream($path, $resource, Config $config)
$this->getBucket(),
$path,
stream_get_contents($resource, -1, 0),
$options
$options['params']
);
}

Expand Down Expand Up @@ -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')) {
Expand Down

0 comments on commit f6985f3

Please sign in to comment.