From 80f8a1a6743724d52377a5775f1fbcb06fb628dc Mon Sep 17 00:00:00 2001 From: chengj Date: Wed, 4 Sep 2024 17:08:19 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:=20=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E6=9C=89=E7=A9=BA=E6=A0=BC=EF=BC=8C=E8=AF=BB=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E6=9D=A5=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8Ceg:=20"te?= =?UTF-8?q?st=20(1).txt"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ObjectClient.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ObjectClient.php b/src/ObjectClient.php index a26617c..c2abed2 100644 --- a/src/ObjectClient.php +++ b/src/ObjectClient.php @@ -11,7 +11,7 @@ class ObjectClient extends Client { public function putObject(string $key, string $body, array $headers = []): Http\Response { - return $this->put(\urlencode($key), \compact('body', 'headers')); + return $this->put(\rawurlencode($key), \compact('body', 'headers')); } /** @@ -27,7 +27,7 @@ public function copyObject(string $key, array $headers): Http\Response throw new InvalidArgumentException('Missing required header: Content-Type'); } - return $this->put(\urlencode($key), array_filter(\compact('headers'))); + return $this->put(\rawurlencode($key), array_filter(\compact('headers'))); } /** @@ -40,12 +40,12 @@ public function postObject(array $multipart): Http\Response public function getObject(string $key, array $query = [], array $headers = []): Http\Response { - return $this->get(\urlencode($key), \compact('query', 'headers')); + return $this->get(\rawurlencode($key), \compact('query', 'headers')); } public function headObject(string $key, string $versionId = null, array $headers = []): Http\Response { - return $this->head(\urlencode($key), [ + return $this->head(\rawurlencode($key), [ 'query' => \compact('versionId'), 'headers' => $headers, ]); @@ -53,7 +53,7 @@ public function headObject(string $key, string $versionId = null, array $headers public function deleteObject(string $key, string $versionId = null): Http\Response { - return $this->delete(\urlencode($key), [ + return $this->delete(\rawurlencode($key), [ 'query' => \compact('versionId'), ]); } @@ -69,7 +69,7 @@ public function deleteObjects(array $body): Http\Response public function optionsObject(string $key): Http\Response { - return $this->options(\urlencode($key)); + return $this->options(\rawurlencode($key)); } public function restoreObject(string $key, array $body, string $versionId = null): Http\Response @@ -78,7 +78,7 @@ public function restoreObject(string $key, array $body, string $versionId = null $body = $body['RestoreRequest']; } - return $this->post(\urlencode($key), [ + return $this->post(\rawurlencode($key), [ 'query' => [ 'restore' => '', 'versionId' => $versionId, @@ -93,7 +93,7 @@ public function selectObjectContents(string $key, array $body): Http\Response $body = $body['SelectRequest']; } - return $this->post(\urlencode($key), [ + return $this->post(\rawurlencode($key), [ 'query' => [ 'select' => '', 'select-type' => 2, @@ -108,7 +108,7 @@ public function putObjectACL(string $key, array $body, array $headers = []): Htt $body = $body['AccessControlPolicy']; } - return $this->put(\urlencode($key), [ + return $this->put(\rawurlencode($key), [ 'query' => [ 'acl' => '', ], @@ -119,7 +119,7 @@ public function putObjectACL(string $key, array $body, array $headers = []): Htt public function getObjectACL(string $key): Http\Response { - return $this->get(\urlencode($key), [ + return $this->get(\rawurlencode($key), [ 'query' => [ 'acl' => '', ], @@ -132,7 +132,7 @@ public function putObjectTagging(string $key, array $body, string $versionId = n $body = $body['Tagging']; } - return $this->put(\urlencode($key), [ + return $this->put(\rawurlencode($key), [ 'query' => [ 'tagging' => '', 'VersionId' => $versionId, @@ -143,7 +143,7 @@ public function putObjectTagging(string $key, array $body, string $versionId = n public function getObjectTagging(string $key, string $versionId = null): Http\Response { - return $this->get(\urlencode($key), [ + return $this->get(\rawurlencode($key), [ 'query' => [ 'tagging' => '', 'VersionId' => $versionId, @@ -153,7 +153,7 @@ public function getObjectTagging(string $key, string $versionId = null): Http\Re public function deleteObjectTagging(string $key, string $versionId = null): Http\Response { - return $this->delete(\urlencode($key), [ + return $this->delete(\rawurlencode($key), [ 'query' => [ 'tagging' => '', 'VersionId' => $versionId, @@ -170,7 +170,7 @@ public function createUploadId(string $key, array $headers): Http\Response throw new InvalidArgumentException('Missing required headers: Content-Type'); } - return $this->post(\urlencode($key), [ + return $this->post(\rawurlencode($key), [ 'query' => [ 'uploads' => '', ], @@ -185,7 +185,7 @@ public function uploadPart(string $key, int $partNumber, string $uploadId, strin public function putPart(string $key, int $partNumber, string $uploadId, string $body, array $headers = []): Http\Response { - return $this->put(\urlencode($key), [ + return $this->put(\rawurlencode($key), [ 'query' => \compact('partNumber', 'uploadId'), 'headers' => $headers, 'body' => $body, @@ -201,7 +201,7 @@ public function copyPart(string $key, int $partNumber, string $uploadId, array $ throw new InvalidArgumentException('Missing required header: x-cos-copy-source'); } - return $this->put(\urlencode($key), [ + return $this->put(\rawurlencode($key), [ 'query' => \compact('partNumber', 'uploadId'), 'headers' => $headers, ]); @@ -213,7 +213,7 @@ public function markUploadAsCompleted(string $key, string $uploadId, array $body $body = $body['CompleteMultipartUpload']; } - return $this->post(\urlencode($key), [ + return $this->post(\rawurlencode($key), [ 'query' => [ 'uploadId' => $uploadId, ], @@ -223,7 +223,7 @@ public function markUploadAsCompleted(string $key, string $uploadId, array $body public function markUploadAsAborted(string $key, string $uploadId): Http\Response { - return $this->delete(\urlencode($key), [ + return $this->delete(\rawurlencode($key), [ 'query' => [ 'uploadId' => $uploadId, ], @@ -239,7 +239,7 @@ public function getUploadedParts(string $key, string $uploadId, array $query = [ { $query['uploadId'] = $uploadId; - return $this->get(\urlencode($key), compact('query')); + return $this->get(\rawurlencode($key), compact('query')); } public function getObjectUrl(string $key): string