adobe / aem-guides-wknd

Tutorial Code companion for Getting Started Developing with AEM Sites WKND Tutorial
https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/overview.html
MIT License
288 stars 569 forks source link

SITES-8366 - [wknd.site] Update CORS configuration to support multiple origins #382

Open raducotescu opened 2 years ago

raducotescu commented 2 years ago

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:

raducotescu commented 2 years ago

For 1. I guess we could add a publish config that's only active on development environments - we should probably add a new dev runmode for that.

For 2. we could wrap these configs inside a Location or LocationMatch directive.

davidjgonzalez commented 2 years ago

@raducotescu

  1. How would we distinguish between AEM SDK dev and AEM as a Cloud service dev? Would a OSGi config on AEM as a Cloud Service Dev be problematic? Or will the httpd config overrwrite any headers that might generate?
  2. IMO, Less is more. If its OK not to add this extra concern, that's simpler from a user POV. If we need to add it from a security POV, then i guess we have to. I was just raising the question to make sure we didn't miss something; ill leave it to yall to determine if its best practice/required.
davidjgonzalez commented 2 years ago

Converting to Draft as this depends on AEM CS release (which contains updates to Dispatcher).