-
-
Notifications
You must be signed in to change notification settings - Fork 100
CORS protection active when same-origin #188
Description
Describe the bug
Trying to make a frontend work by using your API but i keep getting rejected because CORS Filters are still active.
ApiServer == localhost:3455
HttpServer Frontend = localhost:1234
Because its the same domain and CORS is active i get "Same-Origin" CORS back
I tried to overwrite your ApiServer class to make it work but this undertow-cors-filter is garbage and not working.
They found a solution here:
https://stackoverflow.com/questions/42066845/how-to-enable-access-control-allow-origin-in-undertow
but that would mean i have to overwrite your AbsSessionHandler.class . At that point i gave up otherwise i needed to rewrite your whole API :-P
Could you please add this to your AbsSessionHandler.class :
exchange.getResponseHeaders().put(new HttpString("Access-Control-Allow-Origin"), "*"); exchange.getResponseHeaders().put(new HttpString("Access-Control-Allow-Methods"), "GET, POST, PUT, DELETE"); exchange.getResponseHeaders().put(new HttpString("Access-Control-Allow-Headers"), "*");