diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php index c9eea1f..4a3d748 100644 --- a/core/lib/Drupal/Core/CoreServiceProvider.php +++ b/core/lib/Drupal/Core/CoreServiceProvider.php @@ -136,7 +136,7 @@ protected function registerTest(ContainerBuilder $container) { } // Add the HTTP request middleware to Guzzle. $container - ->register('test.http_client.handler', 'Drupal\Core\Test\EventSubscriber\HttpRequestSubscriber') + ->register('test.http_client.middleware', 'Drupal\Core\Test\EventSubscriber\TestHttpClientMiddleware') ->addTag('http_client_middleware'); } diff --git a/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php b/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php index 1a7870c..c9e6f92 100644 --- a/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php +++ b/core/modules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php @@ -91,8 +91,9 @@ public function fetch(FeedInterface $feed) { $actual_uri = NULL; $response = $this->httpClientFactory->fromOptions(['allow_redirects' => [ 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $uri) use (&$actual_uri) { - $actual_uri = (string) $uri; - }]])->send($request); + $actual_uri = (string) $uri; + } + ]])->send($request); // In case of a 304 Not Modified, there is no new content, so return // FALSE. diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index c43508c..4b67ddb 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -240,8 +240,9 @@ function locale_translation_http_check($uri) { $actual_uri = NULL; $response = \Drupal::service('http_client_factory')->fromOptions(['allow_redirects' => [ 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) { - $actual_uri = (string) $request_uri; - }]])->head($uri); + $actual_uri = (string) $request_uri; + } + ]])->head($uri); $result = array(); // Return the effective URL if it differs from the requested. diff --git a/core/modules/simpletest/src/Tests/SimpleTestTest.php b/core/modules/simpletest/src/Tests/SimpleTestTest.php index e4df908..540a838 100644 --- a/core/modules/simpletest/src/Tests/SimpleTestTest.php +++ b/core/modules/simpletest/src/Tests/SimpleTestTest.php @@ -157,7 +157,7 @@ function stubTest() { // request. This allows the stub test to make requests. The event does not // fire here and drupal_generate_test_ua() can not generate a key for a // test in a test since the prefix has changed. - // @see \Drupal\Core\Test\EventSubscriber\HttpRequestSubscriber::onBeforeSendRequest() + // @see \Drupal\Core\Test\EventSubscriber\TestHttpClientMiddleware::onBeforeSendRequest() // @see drupal_generate_test_ua(); $key_file = DRUPAL_ROOT . '/sites/simpletest/' . substr($this->databasePrefix, 10) . '/.htkey'; $private_key = Crypt::randomBytesBase64(55);