-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Approach Being Taken #147
Comments
https://stackoverflow.com/a/43154277/441757
https://annevankesteren.nl/2012/12/cors-101
|
I think the approach of telling everyone to set CORS to * without explaining what they are exposing and giving up is wrong. While one could argue that blindly accepting solutions without research is lazy, you could also say that providing solutions without explanation is equally lazy. There are a good number of resources available that explain what CORS is, what it protects from and how to use it. Some are below. There are very few instances where wildcard needs to be used. Even if you have more than 1 origin, you can use a list and use regex to rewrite headers to only use orgins you specify. Googling CORS multiple origins and the web server you are using should yield results on how to do that. In short, you shouldn't use * unless you TRULY need to allow every possible site on the internet to do cross origin requests to your stuff, which is probably not the case unless you are hosting shared js or css, like a CDN for example.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
https://auth0.com/blog/cors-tutorial-a-guide-to-cross-origin-resource-sharing/
https://www.html5rocks.com/en/tutorials/cors/
https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
The text was updated successfully, but these errors were encountered: