I am currently working on a little GIS web app using MapBox on the frontend and GeoServer as my WMS. I have GeoServer 2.15.0 running under Apache Tomcat 9.0.20. Both of them run on localhost but on different ports.
Problem is, when I want to get some data from GeoServer to load it into my app I get a CORS response.
I have followed many threads and the Apache Docs on how to enable CORS both for Tomcat and for GeoServer using the XML filter configuration. I've followed many answers but nothing seems to work.
As a side note, this only happens to me on Windows, at first I tested it on MacOS on my office computer and everything worked just fine on the first try. So then when I got home and repeated the process on Windows, it doesn't work, and I don't see what else I am missing.
On MacOS i installed Tomcat using Homebrew, on Windows using the Windows Service Installer. I installed GeoServer using the .war file.
This is the error I get on the console and the headers of the request. I am not sure if this is the best way to get JSON data from GeoServer, but it worked fine on the Mac. Following the recommendation, I deactivated Windows Firewall to test it but it still fails.