Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS issue due to upgrade in api-pack #1332

Closed
jspizziri opened this issue Nov 13, 2019 · 3 comments
Closed

CORS issue due to upgrade in api-pack #1332

jspizziri opened this issue Nov 13, 2019 · 3 comments

Comments

@jspizziri
Copy link

jspizziri commented Nov 13, 2019

API Platform version(s) affected: 2.5.1

Description
The upgrade of nelmio/cors-bundle in the api-pack here broke CORS requests.

How to reproduce

cd api
composer update
cd ..
docker-compose build api
docker-compose up -d api

Then attempt to access a resource via admin, and you'll see a 405 on the OPTIONS request.

Possible Solution

Lock down the version of api-pack to require a version that depends on nelmio/cors-bundle:^1.5.

Additional Context

I ran composer update as part of upgrading a v2.4.5 installation to a v2.5.1. I went through the diff and couldn't identify any additional configuration that resolved this issue. I resolved the issue locally by forcing lower version of nelmio/cors-bundle. Ex:

cd api
composer require "nelmio/cors-bundle:^1.5"
cd ..
docker-compose build api
docker-compose up -d api
jspizziri referenced this issue in api-platform/api-pack Nov 15, 2019
@jspizziri
Copy link
Author

jspizziri commented Nov 15, 2019

@dunglas I'd be happy to submit a PR on this if someone told me if you want the version lock in api-pack or in api-platform.

@soyuka
Copy link
Member

soyuka commented Nov 20, 2019

We fixed that issue normally api-platform/core#3265

@jspizziri
Copy link
Author

I've confirmed that api-platform/core >= 2.5.2 and above PR resolves the issue.

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

No branches or pull requests

2 participants