diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 16:44:35 +0300 |
commit | 8bec661288b276c98bdb0e773e5f4d5275dc4c87 (patch) | |
tree | 8617ebe581c62fc46a7881aa61801ebce9d3c603 /vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php | |
parent | 540438c2eb5452bacad30c247906bfa287f2da1d (diff) |
Diffstat (limited to 'vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php')
-rw-r--r-- | vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php b/vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php index 79493df..66e4446 100644 --- a/vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php +++ b/vendor/aws/aws-sdk-php/src/S3/ObjectCopier.php @@ -7,6 +7,7 @@ use Aws\Exception\MultipartUploadException; use Aws\Result; use Aws\S3\Exception\S3Exception; use GuzzleHttp\Promise\Coroutine; +use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Promise\PromisorInterface; use InvalidArgumentException; @@ -79,7 +80,7 @@ class ObjectCopier implements PromisorInterface * * @return Coroutine */ - public function promise() + public function promise(): PromiseInterface { return Coroutine::of(function () { $headObjectCommand = $this->client->getCommand( @@ -144,20 +145,22 @@ class ObjectCopier implements PromisorInterface private function getSourcePath() { + $path = "/{$this->source['Bucket']}/"; if (ArnParser::isArn($this->source['Bucket'])) { try { new AccessPointArn($this->source['Bucket']); + $path = "{$this->source['Bucket']}/object/"; } catch (\Exception $e) { throw new \InvalidArgumentException( 'Provided ARN was a not a valid S3 access point ARN (' - . $e->getMessage() . ')', + . $e->getMessage() . ')', 0, $e ); } } - $sourcePath = "/{$this->source['Bucket']}/" . rawurlencode($this->source['Key']); + $sourcePath = $path . rawurlencode($this->source['Key']); if (isset($this->source['VersionId'])) { $sourcePath .= "?versionId={$this->source['VersionId']}"; } |