Facing CORS error while enabling I AM UNDER ATTACK MODE

TITLE: CORS Error While Security Set To I Am Under Attack

I am trying to setup cloudflare on my web application
I have two domains -
dev.app.com
and
api.app.com


On enabling "I am under attack" in my CloudFlare, I start getting CORS errors -
Access to api.app.com from origin from dev.app.com has been blocked due to missing access-control-allow-origin header.


I implemented
CORS
headers in my Java API backend
My
api.app.com
domain now has
Access-Control-Allow-Origin: https://dev.app.com
header setup.

Why am I still facing error? What is the solution?
Was this page helpful?