diff --git a/core/core.api.php b/core/core.api.php index 63fd607..9f1d4f8 100644 --- a/core/core.api.php +++ b/core/core.api.php @@ -2190,6 +2190,9 @@ function hook_validation_constraint_alter(array &$definitions) { * - context_provider: Indicates a block context provider, used for example * by block conditions. It has to implement * \Drupal\Core\Plugin\Context\ContextProviderInterface. + * - http_client_middleware: Indicates that the service provides a guzzle + * middleware, see https://guzzle.readthedocs.org/en/latest/handlers-and-middleware.html + * for more information. * * Creating a tag for a service does not do anything on its own, but tags * can be discovered or queried in a compiler pass when the container is built, diff --git a/core/core.services.yml b/core/core.services.yml index f9d7cc8..25ae60a 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -379,10 +379,21 @@ services: path.current: class: Drupal\Core\Path\CurrentPathStack arguments: ['@request_stack'] + http_handler_stack: + class: GuzzleHttp\HandlerStack + public: false + factory: GuzzleHttp\HandlerStack::create + configurator: ['@http_handler_stack_configurator', configure] + http_handler_stack_configurator: + class: Drupal\Core\Http\HandlerStackConfigurator + public: false + arguments: ['@service_container'] http_client: - class: Drupal\Core\Http\Client - tags: - - { name: service_collector, tag: http_client_subscriber, call: attach } + class: GuzzleHttp\Client + factory: http_client_factory:fromOptions + http_client_factory: + class: Drupal\Core\Http\ClientFactory + arguments: ['@http_handler_stack'] theme.negotiator: class: Drupal\Core\Theme\ThemeNegotiator arguments: ['@access_check.theme']