# http-middleware
**Repository Path**: mirrors_yiisoft/http-middleware
## Basic Information
- **Project Name**: http-middleware
- **Description**: A collection of PSR-15 middleware focused on HTTP features
- **Primary Language**: Unknown
- **License**: BSD-3-Clause
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-05-17
- **Last Updated**: 2026-01-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Yii HTTP Middleware
[](https://packagist.org/packages/yiisoft/http-middleware)
[](https://packagist.org/packages/yiisoft/http-middleware)
[](https://github.com/yiisoft/http-middleware/actions/workflows/build.yml?query=branch%3Amaster)
[](https://codecov.io/gh/yiisoft/http-middleware)
[](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/http-middleware/master)
[](https://github.com/yiisoft/http-middleware/actions/workflows/static.yml?query=branch%3Amaster)
[](https://shepherd.dev/github/yiisoft/http-middleware)
[](https://shepherd.dev/github/yiisoft/http-middleware)
The package provides a collection of [PSR-15](https://www.php-fig.org/psr/psr-15/#12-middleware) middleware focused on
HTTP features:
- [`ContentLengthMiddleware`](docs/guide/en/content-length-middleware.md) — manages the `Content-Length` header in
the response;
- [`CorsAllowAllMiddleware`](docs/guide/en/cors-allow-all-middleware.md) — adds
[CORS](https://developer.mozilla.org/docs/Web/HTTP/Guides/CORS) headers allowing any request origins in later
requests;
- [`ForceSecureConnectionMiddleware`](docs/guide/en/force-secure-connection-middleware.md) — redirects insecure requests
from HTTP to HTTPS and adds headers necessary to enhance the security policy;
- [`HeadRequestMiddleware`](docs/guide/en/head-request-middleware.md) — removes body from response for `HEAD` request;
- [`HttpCacheMiddleware`](docs/guide/en/http-cache-middleware.md) — implements HTTP caching using `Cache-Control`,
`ETag`, and `Last-Modified` headers;
- [`RemoveBodyMiddleware`](docs/guide/en/remove-body-middleware.md) — removes body from response by status code;
- [`TagRequestMiddleware`](docs/guide/en/tag-request-middleware.md) — 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](https://github.com/yiisoft/proxy-middleware).
## Requirements
- PHP 8.1 or higher.
## Installation
The package could be installed with [Composer](https://getcomposer.org):
```shell
composer require yiisoft/http-middleware
```
## Documentation
- [Guide](docs/guide/en/README.md)
- [Internals](docs/internals.md)
If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place
for that. You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).
## License
The Yii HTTP Middleware is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.
Maintained by [Yii Software](https://www.yiiframework.com/).
## Support the project
[](https://opencollective.com/yiisoft)
## Follow updates
[](https://www.yiiframework.com/)
[](https://twitter.com/yiiframework)
[](https://t.me/yii3en)
[](https://www.facebook.com/groups/yiitalk)
[](https://yiiframework.com/go/slack)