Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
Installs: 43 342 796
Stars: 1 762
Open Issues: 4
- psr/log: ^1.0 || ^2.0 || ^3.0
- symfony/framework-bundle: ^4.4 || ^5.4 || ^6.0
- mockery/mockery: ^1.2
- symfony/phpunit-bridge: ^4.4 || ^5.4 || ^6.0
The NelmioCorsBundle allows you to send Cross-Origin Resource Sharing headers with ACL-style per-URL configuration.
- Handles CORS preflight OPTIONS requests
- Adds CORS headers to your responses
- Configured at the PHP/application level. This is convenient but it also means that any request serving static files and not going through Symfony will not have the CORS headers added, so if you need to serve CORS for static files you probably should rather configure these headers in your web server
nelmio/security-bundle package in your composer.json and update your dependencies:
$ composer require nelmio/cors-bundle
The bundle should be automatically enabled by Symfony Flex. If you don't use Flex, you'll need to enable it manually as explained in the docs.
See the documentation for usage instructions.
Released under the MIT License, see LICENSE.