diff --git a/core/core.services.yml b/core/core.services.yml index f1b8355e79..56cb030919 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -486,6 +486,8 @@ services: class: Drupal\Core\Http\HandlerStackConfigurator public: false arguments: ['@service_container'] + tags: + - { name: service_id_collector, tag: http_client_middleware } http_client: class: GuzzleHttp\Client factory: ['@http_client_factory', 'fromOptions'] diff --git a/core/lib/Drupal/Core/CoreServiceProvider.php b/core/lib/Drupal/Core/CoreServiceProvider.php index 502b1fe918..2c90f6fbc8 100644 --- a/core/lib/Drupal/Core/CoreServiceProvider.php +++ b/core/lib/Drupal/Core/CoreServiceProvider.php @@ -8,7 +8,6 @@ use Drupal\Core\DependencyInjection\Compiler\BackendCompilerPass; use Drupal\Core\DependencyInjection\Compiler\CorsCompilerPass; use Drupal\Core\DependencyInjection\Compiler\DeprecatedServicePass; -use Drupal\Core\DependencyInjection\Compiler\GuzzleMiddlewarePass; use Drupal\Core\DependencyInjection\Compiler\ContextProvidersPass; use Drupal\Core\DependencyInjection\Compiler\ProxyServicesPass; use Drupal\Core\DependencyInjection\Compiler\DependencySerializationTraitPass; @@ -77,8 +76,6 @@ public function register(ContainerBuilder $container) { $container->addCompilerPass(new TaggedHandlersPass()); $container->addCompilerPass(new MimeTypePass()); $container->addCompilerPass(new RegisterStreamWrappersPass()); - $container->addCompilerPass(new GuzzleMiddlewarePass()); - $container->addCompilerPass(new TwigExtensionPass()); // Add a compiler pass for registering event subscribers. diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/GuzzleMiddlewarePass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/GuzzleMiddlewarePass.php deleted file mode 100644 index 91b35807e8..0000000000 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/GuzzleMiddlewarePass.php +++ /dev/null @@ -1,19 +0,0 @@ -findTaggedServiceIds('http_client_middleware')); - $container->getDefinition('http_handler_stack_configurator') - ->addArgument($middleware_ids); - } - -}