Strapi v4 cors gets a bug when use filters operators

System Information
  • Strapi Version:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:


When I use an filter operator in the query it fails and throws a cors error:

Access to XMLHttpRequest at '' from origin '' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I’m not sure it’s really a cors problem, but a bug that causes it.

This query:[name]=thename

works perfectly but[name][$eq]=thename

produces the error

Any operator triggers the error ($eq, $or, $and, $lt, …) like[date][$lte]=2022-03-01&filters[date][$gte]=2022-04-01[$or][0][date][$eq]=2022-03-01&[$or][1]filters[date][$eq]=2022-04-01

This only happens on the server, in localhost all queries work fine.

Anyone else has happened? Does anyone know what the problem is? Any idea how to fix it?