Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor EncodingType in response with ListObjectsV2 as with ListObjects #2918

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nanawel
Copy link

@nanawel nanawel commented May 9, 2024

There seems to be a bug with ListObjectsV2 when dealing with type encoding in responses. The special middleware that's responsible for url-decoding the values in some nodes can only be triggered with ListObjects, so in V2 the client ends up with URL-encoded strings that are not valid in the rest of the application.

private function getEncodingTypeMiddleware()
{
return static function (callable $handler) {
return function (Command $command, $request = null) use ($handler) {
$autoSet = false;
if ($command->getName() === 'ListObjects'
&& empty($command['EncodingType'])
) {
$command['EncodingType'] = 'url';
$autoSet = true;
}

This patch should fix this issue while keeping compatibility with PHP 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant