From 5f030474cae0a3c2095e715052ed5ac36da06544 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Thu, 8 Nov 2018 15:55:18 +0000 Subject: [PATCH] Issue #3001542 by alexpott: Update Guzzle from 6.3.0 to 6.3.3 --- composer.lock | 14 +++++++------- .../src/Functional/FileUploadResourceTestBase.php | 10 +++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 014cc3752e45..4fcfb06381e0 100644 --- a/composer.lock +++ b/composer.lock @@ -754,16 +754,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { @@ -773,7 +773,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "psr/log": "^1.0" }, "suggest": { @@ -782,7 +782,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -815,7 +815,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", diff --git a/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php b/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php index 42c7b2c50a83..cb3ef3e27a0f 100644 --- a/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php @@ -254,7 +254,7 @@ public function testPostFileUploadInvalidHeaders() { $this->assertResourceErrorResponse(415, sprintf('No route found that matches "Content-Type: %s"', static::$mimeType), $response); // An empty Content-Disposition header should return a 400. - $response = $this->fileRequest($uri, $this->testFileData, ['Content-Disposition' => '']); + $response = $this->fileRequest($uri, $this->testFileData, ['Content-Disposition' => FALSE]); $this->assertResourceErrorResponse(400, '"Content-Disposition" header is required. A file name in the format "filename=FILENAME" must be provided', $response); // An empty filename with a context in the Content-Disposition header should @@ -658,7 +658,8 @@ protected function getExpectedNormalizedEntity($fid = 1, $expected_filename = 'e * The file contents to send as the request body. * @param array $headers * Additional headers to send with the request. Defaults will be added for - * Content-Type and Content-Disposition. + * Content-Type and Content-Disposition. In order to remove the defaults set + * the header value to FALSE. * * @return \Psr\Http\Message\ResponseInterface */ @@ -667,12 +668,15 @@ protected function fileRequest(Url $url, $file_contents, array $headers = []) { $url->setOption('query', ['_format' => static::$format]); $request_options = []; - $request_options[RequestOptions::HEADERS] = $headers + [ + $headers = $headers + [ // Set the required (and only accepted) content type for the request. 'Content-Type' => 'application/octet-stream', // Set the required Content-Disposition header for the file name. 'Content-Disposition' => 'file; filename="example.txt"', ]; + $request_options[RequestOptions::HEADERS] = array_filter($headers, function ($value) { + return $value !== FALSE; + }); $request_options[RequestOptions::BODY] = $file_contents; $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions('POST')); -- GitLab