Comments (10)
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.
from nelmiocorsbundle.
Anyone have an idea ?? :s
from nelmiocorsbundle.
up, if someone have an idea ??
from nelmiocorsbundle.
up, i continue to search a solution .. If anyone have an idea
from nelmiocorsbundle.
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
from nelmiocorsbundle.
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.
from nelmiocorsbundle.
+1
symfony: 5.4
nelmiocors: 2.2.0
from nelmiocorsbundle.
+1
Symfony: 5.3.15
Nelmiocors: 2.2.0
from nelmiocorsbundle.
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.
from nelmiocorsbundle.
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:
- web server gets a request
- forwards to php
- PHP runs, Symfony runs, NelmioCorsBundle adds headers
- web server gets back a response
- web server adds duplicate headers
- web server sends the response back to client
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.
from nelmiocorsbundle.
Related Issues (20)
- if origin is not allowed, the `access-control-allow-origin` is not set HOT 2
- Controller action gets executed for invalid origins HOT 2
- https POST request has blocked by CORS policy HOT 6
- PHP Fatal error HOT 3
- Reflected XSS vulnerability
- 400 Bad request on Preflight (CORS Preflight Did Not Succeed) - Symfony 4 HOT 4
- Symfony 5: 502 Bad Gateway HOT 1
- Allow multiple domains for X-Frame-Options (clickjacking) HOT 1
- NelmioCorsBundle not setting ALLOW_ORIGINS (Heroku Server) HOT 2
- Automatic added Vary-header blocks vary-config from SensioFrameworkExtraBundle-annotation HOT 2
- Symfony 6 compatibility HOT 4
- No 'Access-Control-Allow-Origin' header only for some clients HOT 5
- missing CORS header 'Access-Control-Allow-Origin' Front-End REACT, Back-End Symfony 5 with Api Platform and NelmioCorsBundle HOT 14
- Is this project/repository abandoned? HOT 2
- version 2.3.0 blocks use of psr/log:3.0.0, which the latest version of monolog/monolog requires HOT 2
- POST Request returns 400 with wrong Headers HOT 2
- Symfony 7 support HOT 5
- ERR_ABORTED 500 Response to preflight request doesn't pass access control check: It does not have HTTP ok status HOT 1
- allow_credentials: true is ignored
- Usage of logger within the bundle HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nelmiocorsbundle.