diff --git a/src/AwsS3V3/AwsS3V3Adapter.php b/src/AwsS3V3/AwsS3V3Adapter.php index b0309d73c..f95986012 100644 --- a/src/AwsS3V3/AwsS3V3Adapter.php +++ b/src/AwsS3V3/AwsS3V3Adapter.php @@ -195,7 +195,15 @@ private function createOptionsFromConfig(Config $config): array { $options = ['params' => []]; - foreach (array_merge(static::AVAILABLE_OPTIONS, static::MUP_AVAILABLE_OPTIONS) as $option) { + foreach (static::AVAILABLE_OPTIONS as $option) { + $value = $config->get($option, '__NOT_SET__'); + + if ($value !== '__NOT_SET__') { + $options['params'][$option] = $value; + } + } + + foreach (static::MUP_AVAILABLE_OPTIONS as $option) { $value = $config->get($option, '__NOT_SET__'); if ($value !== '__NOT_SET__') { @@ -427,7 +435,7 @@ public function copy(string $source, string $destination, Config $config): void $this->bucket, $this->prefixer->prefixPath($destination), $this->visibility->visibilityToAcl($visibility), - $this->createOptionsFromConfig($config) + $this->createOptionsFromConfig($config)['params'] ); } catch (Throwable $exception) { throw UnableToCopyFile::fromLocationTo($source, $destination, $exception);