Closed Quovandius closed 1 year ago
Anyone have an idea ?? :s
up, if someone have an idea ??
up, i continue to search a solution .. If anyone have an idea
last up, i didn't find any solution currently. I search about nginx configuration, may be its a conflict between nginx vhost and this bundle
I can confirm that if Nginx is also configured to send the CORS headers, there are duplicates created. I removed the Nginx CORS config and the bundle works as expected. An idea is to have the bundle check for the headers and create a warning if duplicates are present.
I can confirm that if Nginx is also configured to send the CORS headers, there are duplicates created. I removed the Nginx CORS config and the bundle works as expected. An idea is to have the bundle check for the headers and create a warning if duplicates are present.
Can confirm, had exactly same problem.
+1 symfony: 5.4 nelmiocors: 2.2.0
+1 Symfony: 5.3.15 Nelmiocors: 2.2.0
The bundle is asf ar as I know never setting duplicate headers, so if you're +1ing here, please give more details or look at what else you have running in your application. Try to look in the symfony profiler for what event listeners you have running after the CorsListener. Do you have symfony http cache in place or something? Just adding +1 will not help anyone that's for sure.
An idea is to have the bundle check for the headers and create a warning if duplicates are present.
The bundle cannot do this check, if you configure your web server to also send CORS headers back in the response what happens is this:
As you can see, the PHP code has no chance to ever see what the web server is doing, so cannot act on that. Only the server admins/application developers can do this. Please learn how your stack works.
Hello,
I try to use this bundle for configure my api. But i have a problem since 2 weeks, and i didn't found any solution. Sorry for the inconvenience. My last configuration is :
Project on server : Debian 8 / nginx / php-fpm
Server side : Symfony 3.0 with FosUserBundle/ FOSRestBundle/ NelmioApiDocBundle / NelmioCorsBundle/ LexikJWTAuthenticationBundle / JMSSerializer
My config.yml :
My security.yml :
And for my client, i use Ionic with angular JS on base project (with skeleton tabs for have a valid login form) :
My config :
and my function (doesn't work):
Error send is :
it seems because my http request have 2 definitions of Access-Control-Allow-Headers and Access-Control-Allow-Origin :
but why ???____??? It seems i have 2 different handler, nelmio and one other, and each put an Access-Control-Allow-Headers / Access-Control-Allow-Origin. The others access-control are OK.
If anyone have an idea, its really appreciated. Thanx for your help.