middlewares / content-length
Middleware to inject the Content-Length header into the response based on the body size
Installs: 11 405
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- laminas/laminas-diactoros: ^2.3
- middlewares/utils: ^3.0
- oscarotero/php-cs-fixer-config: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8|^9
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-10-29 04:04:09 UTC
README
Middleware to inject the Content-Length header into the response based on the body size.
Requirements
- PHP >= 7.2
- A PSR-7 http library
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/content-length.
composer require middlewares/content-length
Example
$dispatcher = new Dispatcher([ new Middlewares\ContentLength() ]); $response = $dispatcher->dispatch(new ServerRequest());
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.