keboola / cors
Minimalistic CORS handlers for Symfony apps
0.4.0
2024-02-20 11:43 UTC
Requires
- php: ^8.2
- ext-json: *
- symfony/http-foundation: ^6.0|^7.0
- symfony/http-kernel: ^6.0|^7.0
Requires (Dev)
- infection/infection: ^0.27.10
- keboola/coding-standard: ^15.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-symfony: ^1.3
- phpunit/phpunit: ^9.6
- sempro/phpunit-pretty-print: ^1.4
README
Adds CORS headers and OPTIONS response to all API endpoints
Usage
composer require keboola/cors
Add this to the services.yaml
file:
Keboola\Cors\CorsListener: arguments: - tags: - { name: kernel.event_listener, event: kernel.request } - { name: kernel.event_listener, event: kernel.response } Keboola\Cors\ResponseHeadersListener: tags: - { name: kernel.event_listener, event: kernel.response }
Development
Run the tests:
docker-compose build docker-compose run tests
To run tests with local code use:
docker-compose run tests-local composer install docker-compose run tests-local
License
MIT licensed, see LICENSE file.