Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dunglas
Copy link
Member

@dunglas dunglas commented Feb 9, 2018

Many people struggle to properly configure CORS handling when creating an API with Symfony 4. To solve this problem, this PR adds NelmioCors (that now has a dedicated Flex recipe) to the pack.

Thanks to the new Flex's unpack feature, adding an extra dependency in the pack isn't a big deal anymore, because the user can easily remove it if he wants to customize the installation.

Another advantage of this PR: it will reduce the gap between the standard API Platform distribution and composer req api.

@Nyholm
Copy link

Nyholm commented Feb 9, 2018

Since this makes sense for most users Im all 👍

@soyuka
Copy link
Member

soyuka commented Feb 9, 2018

I'm still unsure about that because I don't see why an API could not exists without CORS, it's not a "required" feature for the api to work (at least users should know that an API doesn't need to allow cross origin request to work). Anyway, if users are having a hard time doing composer req cors, let's add it to the stack!

@dunglas
Copy link
Member Author

dunglas commented Feb 9, 2018

@soyuka the goal of the pack is to have an "out of the box" solution handling most common cases. As api-platform/core doesn't deal with CORS at all, the user can still remove NelmioCors if he doesn't want it.

Copy link
Contributor

@sroze sroze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, fair enough 👍

@sroze
Copy link
Contributor

sroze commented Feb 9, 2018

Thank you @dunglas.

@sroze sroze merged commit 33ade8a into api-platform:master Feb 9, 2018
@sroze
Copy link
Contributor

sroze commented Feb 9, 2018

Released in 1.1.0 🎆

@dunglas dunglas deleted the cors branch February 9, 2018 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants