From 6b7acf7d3c608a5348324db35d14a1e88a664fe9 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Tue, 3 Jan 2017 12:08:34 +0000 Subject: [PATCH] Issue #2838954 by damiankloip: Ignore 'Transfer-Encoding' header in EntityResourceTestBase::testGet --- .../Functional/EntityResource/EntityResourceTestBase.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 48ed438b6d76..cb11e2e7b24c 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -383,8 +383,11 @@ public function testGet() { $get_headers = $response->getHeaders(); // Verify that the GET and HEAD responses are the same. The only difference - // is that there's no body. - $ignored_headers = ['Date', 'Content-Length', 'X-Drupal-Cache', 'X-Drupal-Dynamic-Cache']; + // is that there's no body. For this reason the 'Transfer-Encoding' header + // is also added to the list of headers to ignore, as this could be added to + // GET requests - depending on web server configuration. This would usually + // be 'Transfer-Encoding: chunked'. + $ignored_headers = ['Date', 'Content-Length', 'X-Drupal-Cache', 'X-Drupal-Dynamic-Cache', 'Transfer-Encoding']; foreach ($ignored_headers as $ignored_header) { unset($head_headers[$ignored_header]); unset($get_headers[$ignored_header]); -- GitLab