-
Notifications
You must be signed in to change notification settings - Fork 638
SITES-8366 - [wknd.site] Update CORS configuration to support multiple origins #382
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
…e origins * implemented CORS rules at the dispatcher level
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 Radu!
Few quick Qs.
- How does this impact local development (AEM SDK/6.5) .. i assume this requires local AEM Headless development to run the Dispatch Tools?
- Could we leave in the CORS OSGi configuration for local development on Publish? Is there a clean way to do that?
- Historically, in the OSGI configuration, we'd set allow URL path patterns for a CORS config; it appears that the dispatcher approach allows a known origin/pattern to CORS any path -- is this is security issue? We configured the OSGi config on principle of least privilege. Just want to very that this is not important (or that im missing the path restrictions somewhere)
For 1. I guess we could add a publish config that's only active on development environments - we should probably add a new For 2. we could wrap these configs inside a |
|
Converting to Draft as this depends on AEM CS release (which contains updates to Dispatcher). |
# CORS - send 204 for CORS requests which are not trusted | ||
RewriteCond expr "reqenv('CORSProcessing') == 'true' && reqenv('CORSTrusted') == 'false'" | ||
RewriteRule "^(.*)" - [R=204,L] | ||
|
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.
This rewrite rule will not work in its current form/position, as conf.d/rewrites/default_rewrite.rules
contains rewrite
at as a last rule with flag [PT]
, and that implicitly implies L
flag. See PT section on https://httpd.apache.org/docs/2.4/rewrite/flags.html
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.
Jabran, have you tested the PR?
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.
Yes, tested this using a local author-publish-dispatcher setup.
Description
This PR moves all publish-tier CORS configuration in the dispatcher, since that's the only layer that can correctly apply
Vary
based caching.How Has This Been Tested?
The dispatcher change configuration has been tested using the Dispatcher SDK.
Types of changes
Checklist: