Middleware to inject the Content-Length header into the response based on the body size
Middleware to inject the Content-Length header into the response based on the body size.
- PHP >= 7.0
- A PSR-7 http message implementation (Diactoros, Guzzle, Slim, etc...)
- A PSR-15 middleware dispatcher
This package is installable and autoloadable via Composer as middlewares/content-length.
composer require middlewares/content-length
$dispatcher = new Dispatcher([ new Middlewares\ContentLength() ]); $response = $dispatcher->dispatch(new ServerRequest());
The MIT License (MIT). Please see LICENSE for more information.