Skip to content

Commit

Permalink
Merge pull request #14 from OneHundred86/master
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Sep 4, 2024
2 parents 637e036 + 80f8a1a commit 5cb1f14
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/ObjectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

/**
Expand All @@ -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')));
}

/**
Expand All @@ -40,20 +40,20 @@ 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,
]);
}

public function deleteObject(string $key, string $versionId = null): Http\Response
{
return $this->delete(\urlencode($key), [
return $this->delete(\rawurlencode($key), [
'query' => \compact('versionId'),
]);
}
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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' => '',
],
Expand All @@ -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' => '',
],
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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' => '',
],
Expand All @@ -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,
Expand All @@ -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,
]);
Expand All @@ -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,
],
Expand All @@ -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,
],
Expand All @@ -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
Expand Down

0 comments on commit 5cb1f14

Please sign in to comment.