Proxy Middleware 1.0
Proxy Middleware 1.0 has been released. The package contains proxy related middleware classes that implement PSR-15:
They were extracted from Yii Middleware package.
TrustedHeaderProtocolResolver
Trusted header protocol resolver sets a server request protocol based on special header you trust such as X-Forwarded-Proto
.
You can use it if your server is behind a trusted load balancer or a proxy that's always setting the special header itself discarding any header values provided by user.
TrustedHostsNetworkResolver
Scans the entire connection chain and resolves the data from forwarded headers taking into account trusted IPs. Additionally, all items' structure is thoroughly validated because headers' data can't be trusted. The following data is resolved:
- IP.
- Protocol
- Host.
- Port.
- IP identifier - unknown or obfuscated. Used with
Forwarded
RFC header.
For forwarded headers it's possible to use both Forwarded
header standardized by RFC 7239 and groups of headers providing data separately.
The typical use case is having an application behind a load balancer.
The code coverage and MSI are close to 100%, static analysis meets the requirements of Psalm level 1.
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- auth client
- view
- bootstrap
- release
- html
- redis
- apidoc
- Yii 2.0
- Yii 1.1
- mongodb
- mailer
- extensions
- twig
- gii
- queue
- runner
- http 客户端
- console
- validation
- cache
- sphinx
- widget
- hydrator
- translator
- symfonymailer
- db
- http
- log
- error handler
- config
- swiftmailer
- 图书
- imagine
- assets
- i18n
- IDE
- swagger
- elasticsearch
- router
- csrf
- smarty
- definitions
- logging
- fastroute
- user