Add Access-Control-Request-Method to the list of forwarded headers - CORS problem #174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I (with help from @t-richard) found this small thing that could be a massive improvement.
I am running a API and want to allow request from my React app. I obviously get issues with CORS but no matter how much I try I failed to solve it...
It turned out to be that Chrome is doing a "preflight" to check CORS headers with an OPTION request. The NelmioCorsBundle is checking for the Access-Control-Request-Method. If that header does not exist, the preflight will fail.
I am not sure if this is needed for CORS or if it is needed for CORS with NelmioCorsBundle. I thought I would share it here and hopefully it will help other developers in the same situation.
The workaround would be to configure forward headers yourself like: