| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | $f = new PresignUrlMiddleware($options, $endpointProvider, $client, $handler); |
| 42 | 42 | return $f; |
| 43 | 43 | }; |
| 44 | 44 | } |
| 45 | - public function __invoke(CommandInterface $cmd, RequestInterface $request = null) | |
| 45 | + public function __invoke(CommandInterface $cmd, ?RequestInterface $request = null) | |
| 46 | 46 | { |
| 47 | 47 | if (\in_array($cmd->getName(), $this->commandPool) && !isset($cmd['__skip' . $cmd->getName()])) { |
| 48 | 48 | $cmd['DestinationRegion'] = $this->client->getRegion(); |
| 49 | 49 | if (!empty($cmd['SourceRegion']) && !empty($cmd[$this->presignParam])) { |
| @@ -81,9 +81,9 @@ | ||
| 81 | 81 | $paramsToAdd = \false; |
| 82 | 82 | if (!empty($this->extraQueryParams[$cmdName])) { |
| 83 | 83 | foreach ($this->extraQueryParams[$cmdName] as $param) { |
| 84 | 84 | if (!\strpos($currentQueryParams, $param)) { |
| 85 | - $paramsToAdd = "&{$param}={$cmd[$param]}"; | |
| 85 | + $paramsToAdd = "&{$param}=" . \urlencode($cmd[$param]); | |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | return (string) $signer->presign(SignatureV4::convertPostToGet($request, $paramsToAdd ?: ""), $client->getCredentials()->wait(), '+1 hour')->getUri(); |