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

feature/disableSetAccessControlAllowOrigin #102

Open
wants to merge 3 commits into
base: master
from

Conversation

@miguelromero2000
Copy link

miguelromero2000 commented Jul 30, 2018

  • Added the possibility to disable having to set the header "Access-Control-Allow-Origin" by setting the option to false - allow_origin: false
  • Added test testPreflightedRequestWithoutOriginDoesNotReturnOriginHeader
…ontrol-Allow-Origin" by setting the option to false - allow_origin: false

- Added test testPreflightedRequestWithoutOriginDoesNotReturnOriginHeader
…ontrolAllowOrigin

feature/disableSetAccessControlAllowOrigin
@miguelromero2000

This comment has been minimized.

Copy link
Author

miguelromero2000 commented Jul 30, 2018

This feature is needed when the header AccessControlAllowOrigin is handled and set in the web server config, in order to avoid 2 headers to be set.

@miguelromero2000

This comment has been minimized.

Copy link
Author

miguelromero2000 commented Jul 30, 2018

By the way, I do not really know why the hhvm build is failing, I think there is something weird in that setup, and nothing related to my PR:

  1. Nelmio\Tests\DependencyInjection\CorsConfigurationProviderPassTest::testCollectProviders
    Error: unknown class PHPUnit\Framework\Constraint\Constraint
    /home/travis/build/nelmio/NelmioCorsBundle/vendor/matthiasnoback/symfony-dependency-injection-test/PhpUnit/DefinitionHasArgumentConstraint.php:10
    /home/travis/build/nelmio/NelmioCorsBundle/vendor/matthiasnoback/symfony-dependency-injection-test/PhpUnit/AbstractContainerBuilderTestCase.php:166
    /home/travis/build/nelmio/NelmioCorsBundle/Tests/DependencyInjection/CorsConfigurationProviderPassTest.php:56
    ERRORS!
    Tests: 16, Assertions: 42, Errors: 1.
@@ -136,6 +136,10 @@ protected function getPreflightResponse(Request $request, array $options)
$response->headers->set('Access-Control-Max-Age', $options['max_age']);
}
if (0 === count($options['allow_origin'])) {

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Nov 6, 2019

missing is_array() check before

@Seldaek

This comment has been minimized.

Copy link
Member

Seldaek commented Nov 6, 2019

This needs a rebase on latest master and the test should be updated to use the new event classes etc to bring it in line then it can be merged for 2.0

@Seldaek

This comment has been minimized.

Copy link
Member

Seldaek commented Nov 6, 2019

Just a question though, what's the point of this, versus simply not using the bundle? Is it to allow prod vs dev config to be different?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.