You are here

public function HandlerStackConfigurator::configure in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Http/HandlerStackConfigurator.php \Drupal\Core\Http\HandlerStackConfigurator::configure()

Configures the stack using services tagged as http_client_middleware.

Parameters

\GuzzleHttp\HandlerStack $handler_stack: The handler stack

File

core/lib/Drupal/Core/Http/HandlerStackConfigurator.php, line 82

Class

HandlerStackConfigurator
Defines a class for configuring middlewares on the http handler stack.

Namespace

Drupal\Core\Http

Code

public function configure(HandlerStack $handler_stack) {
  $this
    ->initializeMiddlewares();
  foreach ($this->middlewares as $middleware_id => $middleware) {
    $handler_stack
      ->push($middleware, $middleware_id);
  }
}