batch.com / headers-bundle
A Symfony bundle to easily add headers to your responses.
Installs: 44 699
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 4
Open Issues: 2
Type:symfony-bundle
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
A Symfony bundle to ease the configuration of global response headers. Instead of creating a response listener to add custom headers, use a configuration file:
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/'
Installation
$ composer require batch.com/headers-bundle
Read the documentation for complete instructions.
Documentation
Read the documentation in src/Resources/doc/