Hi Team,
When I try to hit the graphql API in publish domain, the 'Access-Control-Allow-Origin' header is not showing. I can see this header in normal pages.
but only not coming in graphql API url. Could anyone please help me in this issue.
I have followed below tutorial. But no luck.
https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/d...
Solved! Go to Solution.
Views
Replies
Total Likes
@kamsdurai You need to cors related config in your vhost file, esp allowing the "origins" from where you are trying to make GraphQL query and remove the "origin" header from the request before sending it to Publish instance. Check the example given here
https://github.com/adobe/aem-guides-wknd/blob/main/dispatcher/src/conf.d/available_vhosts/wknd.vhost
# Developer Localhost
SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(http://localhost(:\d+)?$)#" CORSTrusted=true
# Remove Origin before sending to AEM Publish
RequestHeader unset Origin
@kamsdurai You need to cors related config in your vhost file, esp allowing the "origins" from where you are trying to make GraphQL query and remove the "origin" header from the request before sending it to Publish instance. Check the example given here
https://github.com/adobe/aem-guides-wknd/blob/main/dispatcher/src/conf.d/available_vhosts/wknd.vhost
# Developer Localhost
SetEnvIfExpr "env('CORSProcessing') == 'true' && req_novary('Origin') =~ m#(http://localhost(:\d+)?$)#" CORSTrusted=true
# Remove Origin before sending to AEM Publish
RequestHeader unset Origin
@kamsdurai Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies