batch.com /headers-bundle
一个用于轻松添加响应头的 Symfony 扩展包。
2.0.0
2022-08-29 14:48 UTC
Requires
- php: ^8.0
- psr/cache: ^3.0
- symfony/config: ^6.0
- symfony/dependency-injection: ^6.0
- symfony/expression-language: ^6.0
- symfony/http-kernel: ^6.0
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.2
- phpstan/phpstan: ^1.7
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.1
- phpstan/phpstan-strict-rules: ^1.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^9.2
- slevomat/coding-standard: ^8.1
- thecodingmachine/phpstan-safe-rule: ^1.2
- thecodingmachine/phpstan-strict-rules: ^1.0
README
一个用于简化全局响应头配置的 Symfony 扩展包。无需创建响应监听器来添加自定义头,而是使用配置文件
batch_headers: headers: # Apply a CSP on all the responses - Content-Security-Policy: default-src 'self' # Allow your API to be requested from all origins - name: Access-Control-Allow-Origin value: "*" condition: request.getPathInfo() matches '^/api' # Always cache images - name: Cache-Control value: max-age=31536000, public condition: response.headers.get('Content-Type') matches '^image/'
安装
$ composer require batch.com/headers-bundle
阅读文档以获取完整说明。
文档
在 src/Resources/doc/ 阅读文档