-
Notifications
You must be signed in to change notification settings - Fork 9.8k
util/httputil: Always add Vary header in SetCORS (fixes #15406) #16008
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
Conversation
Thanks for this. |
@machine424 Great! Let me know if you need some clarification. Related: rs/cors#10 A different issue is that CORS-preflight response headers like Access-Control-Allow-Headers are included in the response regardless of whether the request is actually a preflight request. The easiest fix for all this would arguably be to rely on a dependable CORS middleware library (e.g. this one 😉). |
Hello from the bug-scrub! @machine424 do you think you will get a chance to look at this? |
@machine424 I'm here if you need me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks.
Have some suggestions.
I see you're very interested in CORS and you did an excellent job with jub0bs/cors
!
As you see our CORS setup is really simple (admittedly not flawless though ;)) and I’m personally hesitant to introduce a new dependency just for that.
If we ever need to make more substantial changes into that code in the future, I’d certainly keep jub0bs/cors
in mind.
Of course, additional issues are uncovered in the meantime, we may decide to delegate that sooner.
Meanwhile my two cents, for better transparency/traceability in jub0bs/cors
; it'd be great to use PRs rather than directly merging into main (even though you're the only contributor). Also linking those PRs in the changelog would help users better track the changes.
the failing test was fixed on main, rebasing should help. |
Closes #15406 Signed-off-by: jub0bs <jcretel-infosec+github@protonmail.com>
Thanks. That's fair. One obstacle to your adoption of
Thanks, I'll take your suggestion into consideration. I'm getting closer to releasing a v1; I can start using PRs then. Whatever happens, I make sure to document, in the changelog, any changes that may affect users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks again!
Closes #15406
Also, drop Origin from the Access-Control-Allow-Headers response header; see https://fetch.spec.whatwg.org/#forbidden-request-header.