I have made all configs mentioned in the below URL to enable CORS for some specific domains.
https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/security/understand-cross-origin-resource-sharing.html?lang=en
But, it is not working when rendering the AEM URL through dispatch...