The package provides a collection of PSR-15 middleware focused on HTTP features:
ContentLengthMiddleware
— manages theContent-Length
header 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 forHEAD
request;HttpCacheMiddleware
— implements HTTP caching usingCache-Control
,ETag
, andLast-Modified
headers;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.
- PHP 8.1 or higher.
The package could be installed with Composer:
composer require yiisoft/http-middleware
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.
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.