-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Docs: Add CORS examples #62439
Docs: Add CORS examples #62439
Conversation
docs/02-app/01-building-your-application/01-routing/12-route-handlers.mdx
Outdated
Show resolved
Hide resolved
const origin = request.headers.get('origin') ?? '' | ||
const isAllowedOrigin = allowedOrigins.includes(origin) | ||
|
||
// Handle preflighted requests |
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.
Have we used this "preflight" terminology elsewhere?
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.
We link to the MDN docs explanation in the paragraph above. This is mostly for those using the OPTIONS method.
Show how to set CORS headers in:
next.config.js
(Multiple Endpoints)