Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 22, 2024 via composer

nelmio/cors-bundle 1.2.0

Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony2 application
Package summary
Share
3
issues
3
high severity
vulnerability
1
meta
2
1
license
30
MIT
Package created
8 Dec 2011
Version published
29 Oct 2013
Maintainers
1
Total deps
30
Direct deps
1
License
MIT

Issues

3

3 high severity issues

high
via: symfony/framework-bundle@v2.8.52
via: symfony/framework-bundle@v2.8.52
via: symfony/framework-bundle@v2.8.52
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
30 Packages, Including:
doctrine/annotations@1.14.3
doctrine/cache@1.13.0
doctrine/deprecations@1.1.3
doctrine/lexer@2.1.1
nelmio/cors-bundle@1.2.0
psr/cache@3.0.0
psr/log@1.1.4
symfony/asset@v3.0.9
symfony/class-loader@v3.0.9
symfony/config@v2.8.52
symfony/debug@v2.8.52
symfony/dependency-injection@v2.8.52
symfony/event-dispatcher@v3.0.9
symfony/filesystem@v3.0.9
symfony/finder@v3.0.9
symfony/framework-bundle@v2.8.52
symfony/http-foundation@v2.8.52
symfony/http-kernel@v2.8.52
symfony/polyfill-ctype@v1.29.0
symfony/polyfill-mbstring@v1.29.0
symfony/polyfill-php54@v1.20.0
symfony/polyfill-php55@v1.20.0
symfony/polyfill-php56@v1.20.0
symfony/polyfill-php70@v1.20.0
symfony/routing@v2.8.52
symfony/security-core@v3.4.49
symfony/security-csrf@v3.4.47
symfony/stopwatch@v3.0.9
symfony/templating@v3.0.9
symfony/translation@v2.8.52
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of nelmio/cors-bundle 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
symfony/framework-bundlev2.8.52-MIT
prod
3

Visualizations

Frequently Asked Questions

What does nelmio/cors-bundle do?

The NelmioCorsBundle package essentially enables Cross-Origin Resource Sharing (CORS) headers support in your Symfony PHP application. This is key for allowing secure cross-domain data transfers, with an emphasis on building API-based infrastructure that's compatible with AJAX calls in web applications.

How do you use nelmio/cors-bundle?

You can integrate and use the nelmio/cors-bundle in your Symfony application in the following way:

Firstly, install the package via Composer. If you're using Symfony Flex, you can run:

composer req cors

For non-Symfony Flex use, require the nelmio/cors-bundle in your composer.json and update your dependencies:

$ composer require nelmio/cors-bundle

Then, add the NelmioCorsBundle to your application's kernel:

public function registerBundles()
{
    $bundles = [
        // ...
        new Nelmio\CorsBundle\NelmioCorsBundle(),
        // ...
    ];
    // ...
}

Next, Symfony Flex generates a default configuration in config/packages/nelmio_cors.yaml. You can customize the CORS settings for paths and allowed headers and methods. An example configuration:

nelmio_cors:
    defaults:
        allow_origin: ['*']
        allow_headers: ['X-Custom-Auth']
        allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
        max_age: 3600
    paths:
        '^/api/':
            allow_origin: ['*']
            allow_headers: ['X-Custom-Auth']
            allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
            max_age: 3600

Here, CORS requests from any origin are allowed on /api/, with some methods defined as allowed. Preflight requests can be cached for 3600 seconds.

Where are the nelmio/cors-bundle docs?

The documentation for the nelmio/cors-bundle lives in the README file on the GitHub repository (https://github.com/nelmio/NelmioCorsBundle), where you can find information about the package's features, installation instructions, configuration guidance, and a cookbook section on how to handle specific use cases.