I've resolved the issue; it wasn't related to CORS. In Azure, when WAF is enabled, it doesn't accept special characters, which was causing the error