Unverified Commit 02e787a5 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3215397 by dpi, dhirendra.mishra, longwave: Service tag priority does...

Issue #3215397 by dpi, dhirendra.mishra, longwave: Service tag priority does not work with HTTP Client Middleware
parent 1110b04d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -489,6 +489,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']
+0 −3
Original line number Diff line number Diff line
@@ -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.
+0 −19
Original line number Diff line number Diff line
<?php

namespace Drupal\Core\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class GuzzleMiddlewarePass implements CompilerPassInterface {

  /**
   * {@inheritdoc}
   */
  public function process(ContainerBuilder $container) {
    $middleware_ids = array_keys($container->findTaggedServiceIds('http_client_middleware'));
    $container->getDefinition('http_handler_stack_configurator')
      ->addArgument($middleware_ids);
  }

}