Download the PHP package ctw/ctw-middleware-generatedby without Composer
On this page you can find all versions of the php package ctw/ctw-middleware-generatedby. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ctw/ctw-middleware-generatedby
More information about ctw/ctw-middleware-generatedby
Files in ctw/ctw-middleware-generatedby
Package ctw-middleware-generatedby
Short Description This PSR-15 middleware adds an X-Generated-By UUID v5 to the Response header.
License BSD-3-Clause
Informations about the package ctw-middleware-generatedby
Package "ctw/ctw-middleware-generatedby"
PSR-15 middleware to create a UUID v5 (Universally Unique Identifiers) and add it to the X-Generated-By
header of the response. The UUID is created using the server IP address i.e. $_SERVER['SERVER_ADDR']
and domain name of the application i.e. $_SERVER['SERVER_NAME']
.
This functionality is useful when multiple applications servers are running behind a load balancer. By inspecting the X-Generated-By
header, it is possible to find out exactly which application server processed the request without exposing its public IP addresses.
middlewares/utils provides utility classes for working with PSR-15 and ramsey/uuid provides UUID v5 generation.
Installation
Install the middleware using Composer:
Standalone Example
Example in Mezzio
The middleware has been extensively tested in Mezzio.
After using Composer to install, simply make the following changes to your application's configuration.
In config/config.php
:
In config/pipeline.php
:
You can then test to ensure that the X-Generated-At
header is in the returned HTTP headers with:
If you see the X-Generated-At
header, the middleware is correctly installed:
All versions of ctw-middleware-generatedby with dependencies
ctw/ctw-middleware Version ^4.0
laminas/laminas-diactoros Version ^2.11
psr/container Version ^1.0 || ^2.0
ramsey/uuid Version ^4.1