Git Product home page Git Product logo

Comments (10)

tim-massey avatar tim-massey commented on June 7, 2024 2

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.

Quovandius avatar Quovandius commented on June 7, 2024

Anyone have an idea ?? :s

from nelmiocorsbundle.

Quovandius avatar Quovandius commented on June 7, 2024

up, if someone have an idea ??

from nelmiocorsbundle.

Quovandius avatar Quovandius commented on June 7, 2024

up, i continue to search a solution .. If anyone have an idea

from nelmiocorsbundle.

Quovandius avatar Quovandius commented on June 7, 2024

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.

romantaranenko avatar romantaranenko commented on June 7, 2024

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.

devjerry0 avatar devjerry0 commented on June 7, 2024

+1
symfony: 5.4
nelmiocors: 2.2.0

from nelmiocorsbundle.

Navds avatar Navds commented on June 7, 2024

+1
Symfony: 5.3.15
Nelmiocors: 2.2.0

from nelmiocorsbundle.

Seldaek avatar Seldaek commented on June 7, 2024

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.

Seldaek avatar Seldaek commented on June 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.