Comments (19)
So the opposite of #49 ?
I understand the case, if you don't use credentials, I think * is probably fine and better for caching indeed.
from stack-cors.
So the opposite of #49 ?
Uhh... kind of. From reading #49 it seems a little misguided. If the the request needs to be varried by the Origin
then it should always add it (even if it's not necessarily a cors request, as it could become one). If it doesn't need to be, it shouldn't be. I think adding this as configuration is more confusing.
In other words, this logic doesn't make any sense:
because if the request is missing the
Origin
header (for wahtever reason) or comes from the same Origin
it gets cached as a non-cors request, which would break all subsequent cross-origin requests. :(
I think it should follow this logic:
if ( $config['supportsCredentials'] === true || $config['allowedOrigins'] !== ['*']) {
// Set or append `Origin` to `Vary` header on all requests.
}
from stack-cors.
FYI: This is still an issue because of:
stack-cors/src/Asm89/Stack/Cors.php
Lines 48 to 50 in 561a5ee
from stack-cors.
Lastly, we should deal with this:
Lines 48 to 50 in 456655a
at a minimum, it should check that the method is OPTIONS
first:
stack-cors/src/CorsService.php
Lines 70 to 75 in 456655a
from stack-cors.
Can we close this now?
from stack-cors.
Can we close this now?
Yep! It looks so beautiful! :) Thank you so much!
from stack-cors.
Okay I've tagged a 2.0.0-beta1 so please test it out :)
from stack-cors.
Okay I've tagged a 2.0.0-beta1 so please test it out :)
Oh where was the breaking change?
from stack-cors.
Well, the behavior has changed a bit imho, not sure if that qualifies as actually breaking. Is that a problem?
from stack-cors.
Well, the behavior has changed a bit imho, not sure if that qualifies as actually breaking. Is that a problem?
I have no idea, I can submit the Drupal patch. :)
from stack-cors.
Looking at https://semver.org/ it seems like this would be a minor since we didn't change the public API at all. The breaking change would be removing the methods we no longer use. :) but your call. :)
from stack-cors.
I guess the question is: Does this change break backwards compatability? It doesn't seem like it does. I could argue that it's actually a bug fix and not even a new feature.
from stack-cors.
Seems like it would be wise to release a beta version of the point release (i.e. 1.4.0-beta1
) though.
from stack-cors.
A breaking change to semantics is also a breaking change, even if there's no breaking changes to the signatures.
from stack-cors.
2.0.0-beta1 was the right choice.
from stack-cors.
A breaking change to semantics is also a breaking change, even if there's no breaking changes to the signatures.
https://semver.org/ defines a breaking change as a change in the "Public API" not to the semantics, but true you may define the Public API however you want. :)
from stack-cors.
A change to the semantics IS a breaking change to the public API...
from stack-cors.
A change to the semantics IS a breaking change to the public API...
well I'm not sure how anyone could argue with that level of circular reasoning.
from stack-cors.
Here's the issue in Drupal's Queue
https://www.drupal.org/project/drupal/issues/3128982
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
- Always set `Vary: Origin` HOT 5
- 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
- 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.