Comments (5)
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.
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.
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.
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.
I think this should all be fixed now.
from stack-cors.
Related Issues (20)
- False positives when detecting CORs Request HOT 2
- TypeError: implode(): Argument #2 ($array) must be of type ?array, bool given in implode() (line 199 of /vendor/asm89/stack-cors/src/CorsService.php) HOT 1
- Allow manual override of the Access-Control-Allow-Origin header HOT 1
- More helpful error response HOT 3
- Delete pointless develop branch
- Tag new release HOT 8
- New tag for Symfony 3 support HOT 6
- Release a 1.0.1 with just https://github.com/asm89/stack-cors/commit/6daf5757971173b79ddabbd755d59d333c278f42 HOT 6
- Browser receiving Access-Control-Allow-Origin:* instead of actual values HOT 1
- Composer says PHP 5.5 supported, but not tested on CI HOT 1
- Packagist not auto-updating HOT 4
- Stack middleware causes loss of existing Vary headers HOT 1
- Only Vary the request when necessary HOT 19
- Access control is unnecessary HOT 4
- Upgrade squizlabs/php_codesniffer
- Rename supports_credentials to allow_credentials HOT 1
- Problem with asm89/stack-cors 1.3.0, installing barryvdh/laravel-cors HOT 7
- Nullable header values bug HOT 2
- Add regex support in allowedOrigins 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 stack-cors.