I am getting this following error due to Access-Control-Allow-Origin header getting set twice
Access to XMLHttpRequest at 'https://cms.yyy.com/api/data/all' from origin 'https://xxx.yyy.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'https://xxx.yyy.com,https://xxx.yyy.com', but only one is allowed.
I am using strapi cms for my backend data. strapi::cors is already added in middleware. I have already tried these following configs
1.
{
name: 'strapi::cors',
config: {
origin: ['https://xxx.yyy.com'],
},
{
name: 'strapi::cors',
config: {
origin: 'https://xxx.yyy.com',
},
{
name: 'strapi::cors',
config: {
origin: "*",
},
but none of this solved the issue.
strapi version:- 4.15.5

you can add this to middleware.ts