nelmio / NelmioCorsBundle

Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
https://symfony.com/bundles/NelmioCorsBundle/
MIT License
1.89k stars 108 forks source link

Access-Control-Allow-Headers should not be set if the value is null. #69

Closed gmoreira closed 7 years ago

gmoreira commented 7 years ago

My scenario is that the preflight OPTIONS request is occurring on a HTTP DELETE request.

In this scenario, only the Access-Control-Request-Method: DELETE header is specified, and not Access-Control-Allow-Headers. As a result, line 117 would set this header to null value.

This PR proposes to safeguard this logic to only set this header when required.

Seldaek commented 7 years ago

Thanks