-
Notifications
You must be signed in to change notification settings - Fork 276
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
[sitecore-jss-nextjs][sitecore-jss] multi-origin CORS validation for next editing middlewares #1798
Conversation
…ation and apply it to next editing middlewares
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.
Looks nice! See some comments below
Please, update the CHANGELOG as well
packages/sitecore-jss-nextjs/src/editing/editing-config-middleware.ts
Outdated
Show resolved
Hide resolved
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.
Looks great 👍
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.
nice!
Description / Motivation
CORS configuration through next config only allows to set a single allowed origin - or a wildcard.
JSS editing API endpoints require a more sophisticated configuration. This PR adds a function to validate incoming origin against multiple possible values, with an option to configure more allowed origins through env variable.
It also applies this CORS validation function to editing middleware handlers:
Testing Details
Types of changes