Comments (6)
Can you activate the logs because this header is set unconditionally on preflight requests (see https://github.com/rs/cors/blob/master/cors.go#L255).
from cors.
Scratch that. Turns out I did not add Authorization to AllowedHeaders so it did not return the Access-Control-Allow-Origin.
from cors.
ok np :)
from cors.
It would be more clear if these lines from https://github.com/rs/cors/blob/master/cors.go#L232
headers.Add("Vary", "Origin")
headers.Add("Vary", "Access-Control-Request-Method")
headers.Add("Vary", "Access-Control-Request-Headers")
Would be sent later after all checks are passed.
from cors.
True but it would defeat the goal of those headers. A request rejected by one of the checks could then be cached and served to requests with different set of headers (i.e: valid ones).
from cors.
Thanks, this saved my life.
from cors.
Related Issues (20)
- Will support fasthttp router?
- security issue: should not allow rejected requests to go forward HOT 4
- Unexpected response when requesting with multiple comma separated origins and wildcard AllowedOrigins HOT 6
- gocover.io has shut down HOT 1
- gin wrapper default status HOT 1
- Listing Origin as an allowed request header is unnecessary HOT 4
- No way to disable caching of preflight responses HOT 1
- Access-Control-Expose-Headers should be sent in preflight response HOT 2
- AllowOriginRequestFunc considered harmful (may lead to Web cache poisoning) HOT 2
- Allowing methods that are not uppercase should be possible but isn't HOT 5
- Unexpected `Access-Control-Expose-Headers` header behavior HOT 2
- [Feature Request] AllowCredentialsFunc: boolean, HOT 2
- Middleware benchmarks are still skewed (follow-up to #156)
- AllowedOrigins doesn't block unlisted origins HOT 2
- .
- Some malicious/spoofed preflight requests cause prohibitive load HOT 3
- cors not adding multiple Access-Control-Allow-Origin entries HOT 2
- failing local test since v1.11.0 HOT 3
- Case-sensitive look up on allowed headers map HOT 4
- Arbitrary origin allowed in CORS header HOT 1
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 cors.