Skip to content

CORS protection active when same-origin #188

@spocon

Description

@spocon

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"), "*");

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions