PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
← All changes | includes/sdk/s3/Aws/Api/Serializer/JsonRpcSerializer.php +6 -3 1.2.13 → 1.4.2 View file →
@@ -27,9 +27,9 @@
27 27 * @param Service $api Service description
28 28 * @param string $endpoint Endpoint to connect to
29 29 * @param JsonBody $jsonFormatter Optional JSON formatter to use
30 30 */
31 - public function __construct(Service $api, $endpoint, JsonBody $jsonFormatter = null)
31 + public function __construct(Service $api, $endpoint, ?JsonBody $jsonFormatter = null)
32 32 {
33 33 $this->endpoint = $endpoint;
34 34 $this->api = $api;
35 35 $this->jsonFormatter = $jsonFormatter ?: new JsonBody($this->api);
@@ -49,11 +49,14 @@
49 49 {
50 50 $operationName = $command->getName();
51 51 $operation = $this->api->getOperation($operationName);
52 52 $commandArgs = $command->toArray();
53 - $headers = ['X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $operationName, 'Content-Type' => $this->contentType];
53 + $body = $this->jsonFormatter->build($operation->getInput(), $commandArgs);
54 + $headers = ['X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $operationName, 'Content-Type' => $this->contentType, 'Content-Length' => \strlen($body)];
54 55 if ($endpoint instanceof RulesetEndpoint) {
55 56 $this->setEndpointV2RequestOptions($endpoint, $headers);
56 57 }
57 - return new Request($operation['http']['method'], $this->endpoint, $headers, $this->jsonFormatter->build($operation->getInput(), $commandArgs));
58 + $requestUri = $operation['http']['requestUri'] ?? null;
59 + $absoluteUri = \str_ends_with($this->endpoint, '/') ? $this->endpoint : $this->endpoint . $requestUri;
60 + return new Request($operation['http']['method'], $absoluteUri, $headers, $body);
58 61 }
59 62 }