Download the PHP package vira/hpropagate without Composer
On this page you can find all versions of the php package vira/hpropagate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vira/hpropagate
More information about vira/hpropagate
Files in vira/hpropagate
Package hpropagate
Short Description Symfony bundle for propagating http headers from incoming requests to the corresponding outgoing requests automatically
License MIT
Informations about the package hpropagate
hpropagate-symfony
This package automatically propagates HTTP headers from inbound to outbound HTTP requests. It also will add a request ID to all monolog logs under req.id
to follow the format used in our node services here
Requirements
- PHP >= 8.1
- Symfony 6.3.x
The Why
We use a microservice architecture with a growing number of HTTP endpoints. We want to propagate certain HTTP headers received from the incoming HTTP requests to all subsequent outbound HTTP requests without the need for our engineers to do it programmatically in each service:
By default, the following headers are automatically propagated:
- x-request-id. If the header is missing from the inbound request, it will be created with a UUID as value.
Apart from x-request-id, only headers received on the incoming request will be propagated to outbound calls.
Installation
composer require vira/hpropagate
Then add the following to your bundles file:
Configuration
There is some optional configuration to be able to propagate more headers than just x-request-id
:
All versions of hpropagate with dependencies
ext-json Version *
symfony/framework-bundle Version ^6.3|^7.0
symfony/uid Version ^6.3|^7.0
monolog/monolog Version ^3.4
symfony/http-client Version ^6.3|^7.0