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 18, 2024 via composer

nelmio/cors-bundle 1.5.6

Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony2 application
Package summary
Share
1
issue
1
high severity
meta
1
1
license
29
MIT
Package created
8 Dec 2011
Version published
17 Jun 2019
Maintainers
1
Total deps
29
Direct deps
1
License
MIT

Issues

1

1 high severity issue

high
via: symfony/framework-bundle@v4.4.51
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
29 Packages, Including:
nelmio/cors-bundle@1.5.6
psr/cache@2.0.0
psr/container@1.1.2
psr/log@2.0.0
symfony/cache@v5.4.39
symfony/cache-contracts@v2.5.3
symfony/config@v5.4.39
symfony/debug@v4.4.44
symfony/dependency-injection@v5.4.39
symfony/deprecation-contracts@v3.5.0
symfony/error-handler@v4.4.44
symfony/event-dispatcher@v4.4.44
symfony/event-dispatcher-contracts@v1.10.0
symfony/filesystem@v5.4.39
symfony/finder@v5.4.39
symfony/framework-bundle@v4.4.51
symfony/http-client-contracts@v2.5.3
symfony/http-foundation@v5.4.39
symfony/http-kernel@v4.4.51
symfony/polyfill-ctype@v1.29.0
symfony/polyfill-mbstring@v1.29.0
symfony/polyfill-php73@v1.29.0
symfony/polyfill-php80@v1.29.0
symfony/polyfill-php81@v1.29.0
symfony/process@v6.4.7
symfony/routing@v5.4.39
symfony/service-contracts@v2.5.3
symfony/var-dumper@v5.4.39
symfony/var-exporter@v6.4.7
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-bundlev4.4.51272.98 kBMIT
prod
1

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.