CORS Error | Community
Skip to main content
Level 5
May 22, 2023
Solved

CORS Error

  • May 22, 2023
  • 2 replies
  • 1035 views

Hello Team,

 

We have added one JSON file in our dam at below path:

/content/dam/mysite/file.json which is holding some JSON content.

so when we call it from our endsite domain i.e. https://mysite.com/content/dam/mysite/file.json, It give me response.

 

Requirement:

There is other application hosted using Other Domain.

e.g. https://otherdomain.com , from this domain, they are trying to make call to this url "https://mysite.com/content/dam/mysite/file.json," and they get CORS error in Network. Something as below:

How can we solve this problem? something at dispatcher level, we need to? because in CORS cofiguration in AEM publish, we have allowed domain as "*"

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Vijay_Katoch
Community Advisor
Community Advisor
May 22, 2023
aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
May 22, 2023
arvind-1Author
Level 5
May 22, 2023

Hi @aanchal-sikka  @vijay_katoch   

 

Thanks for your kind reply.

 

I added below line in virtual host and It fixed the issue:

 

SetEnvIf Origin "https://otherdomain.com" cors
Header set Access-Control-Allow-Origin " https://otherdomain.com" env=cors