yiisoft / http-middleware
A collection of PSR-15 middlewares focused on HTTP features
Fund package maintenance!
Opencollective
yiisoft
Installs: 2 674
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 12
Forks: 0
Open Issues: 0
pkg:composer/yiisoft/http-middleware
Requires
- php: ^8.1
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- httpsoft/http-message: ^1.1.6
- maglnet/composer-require-checker: ^4.7.1
- phpunit/phpunit: ^10.5.46
- rector/rector: ^2.0.16
- roave/infection-static-analysis-plugin: ^1.35
- spatie/phpunit-watcher: ^1.24
- vimeo/psalm: ^5.26.1 || ^6.11.0
This package is auto-updated.
Last update: 2025-10-09 11:26:29 UTC
README
Yii HTTP Middleware
The package provides a collection of PSR-15 middleware focused on HTTP features:
ContentLengthMiddleware— manages theContent-Lengthheader in the response;CorsAllowAllMiddleware— adds CORS headers allowing any request origins in later requests;ForceSecureConnectionMiddleware— redirects insecure requests from HTTP to HTTPS and adds headers necessary to enhance the security policy;HeadRequestMiddleware— removes body from response forHEADrequest;HttpCacheMiddleware— implements HTTP caching usingCache-Control,ETag, andLast-Modifiedheaders;RemoveBodyMiddleware— removes body from response by status code;TagRequestMiddleware— adds specific header to request, which can be used for logging or debugging purposes.
For proxy related middleware, there is a separate package Yii Proxy Middleware.
Requirements
- PHP 8.1 or higher.
Installation
The package could be installed with Composer:
composer require yiisoft/http-middleware
Documentation
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii HTTP Middleware is free software. It is released under the terms of the BSD License.
Please see LICENSE for more information.
Maintained by Yii Software.