Giter VIP home page Giter VIP logo

Comments (5)

typhonius avatar typhonius commented on August 23, 2024 3

Adding a note here that we're bumping into this with sites that use this library and have different requests from different origins being stored in Varnish cache. In line with what @wimleers is observing, when the request comes from the same origin, the response doesn't include a Vary header that then causes CORS blockages for future requests that receive the cached response.

By always adding Vary: Origin, we'll cache different responses for each origin and the issue should be resolved.

from stack-cors.

asm89 avatar asm89 commented on August 23, 2024

Sounds fair.

@wimleers Could you work on a pull request? Since this library has been stable for a long time, perhaps we should put the "always reply with Vary: Origin" behavior behind a new configuration option.

from stack-cors.

mrbaileys avatar mrbaileys commented on August 23, 2024

Created a pull request that added an additional option 'alwaysSetVaryOrigin'. If not set (default), current behavior remains unchaged. When the flag is set, this library will add a Vary: Origin header to all responses.

from stack-cors.

davidbarratt avatar davidbarratt commented on August 23, 2024

Can you all try out #68 and see if it resolves your problem? I think it should fix the cacheability without adding new configuration.

from stack-cors.

barryvdh avatar barryvdh commented on August 23, 2024

I think this should all be fixed now.

from stack-cors.

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.