-
-
Notifications
You must be signed in to change notification settings - Fork 869
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
Upgrade from 3.3.6 to 3.3.7 leads to 405 for OPTIONS request on / #6455
Comments
is it this change? #6437 should we add OPTIONS as well? |
Ah, does this change only allow GET and HEAD for /, /docs etc? |
If I'm not mistaken, Maybe do we need to update the default Nelmio config? |
It seems you have now to send the correct headers that it is a preflight request. When i find time i will try to find out why this is now required. public function testOptionsWhenNotLoggedIn() {
static::createBasicClient()->request(
'OPTIONS',
'/',
[
'headers' => [
'Origin' => 'http://localhost:3000',
'Access-Control-Request-Method' => 'GET',
'Access-Control-Request-Headers' => 'Origin, Content-Type, Accept, Authorization'
]
]
);
$this->assertResponseStatusCodeSame(200);
} |
This seems now to be necessary after the upgrade of api-platform. see api-platform/core#6455
This seems now to be necessary after the upgrade of api-platform. see api-platform/core#6455
This seems now to be necessary after the upgrade of api-platform. see api-platform/core#6455
This seems now to be necessary after the upgrade of api-platform. see api-platform/core#6455
This seems now to be necessary after the upgrade of api-platform. see api-platform/core#6455
Related to api-platform/core#6455 It is more or less the same test as in https://github.com/ecamp/ecamp3/blob/3cd279fd1c1367287ea989f38f7238f93026e4b4/api/tests/Api/RootTest.php
I added a test to the api-platform/demo repo. |
API Platform version(s) affected: 3.3.7
Description
After the upgrade of api-platform from 3.3.6 to 3.3.7, our test
https://github.com/ecamp/ecamp3/blob/3cd279fd1c1367287ea989f38f7238f93026e4b4/api/tests/Api/RootTest.php
fails.
It returns the following:
The PR is here:
The header with
Allow:
makes sense, but i would expect that api-platform returns a 2x status code for the OPTIONS request.(And that this behaviour does not change in a bugfix update).
Or do we need to allow OPTIONS Requests explicitly for all routes?
How to reproduce
See the test
Possible Solution
I did not see which change between 3.3.6 and 3.3.7 might have caused this.
Either update the Changelog or change the behaviour back.
Additional Context
The text was updated successfully, but these errors were encountered: