-
Notifications
You must be signed in to change notification settings - Fork 1.2k
CORS: Allow any header for the simmetry with anyHost #5241
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new public method Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5–10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.kt📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-05-30T06:45:52.309ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bjhham
left a comment
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.
Please introduce a test in io.ktor.tests.server.plugins.CORSTest for the new behaviour.
It looks like this will respond with a forbidden from using the headers field instead of headerPredicates. Check out io.ktor.server.plugins.cors.CORSUtilsKt#corsCheckRequestHeaders.
Subsystem
Server: CORS
Motivation
There is a function to allow any host (anyHost). Since 2016 it is allowed to pass '*' to headers as well: whatwg/fetch#251. I expect to have anyHeader.
Solution
Added the function.