I am trying to setup CORS in java playframework 2.4.x withouth success. My front-end app is using AngularJS 1.3.x.
I implemented the Filters class as per documentation but my preflights OPTIONS requests from AngularJS fail without apparent reason.
This is my application.conf values regarding the filter:
NOTE: I edited the domain names (I am not the owner of example.com) ;)
...
play.filters.cors {
allowedOrigins = ["http://example.com", "http://beta.example.com", "http://example.com/beta"]
allowedHttpMethods = ["GET", "POST", "PUT", "OPTIONS", "DELETE"]
allowedHttpHeaders = ["Accept", "Content-type"]
preflightMaxAge = 3 days
}
...
My play application is hosted in a separate server from the front-end: I essentially have a sub-directory on my main hosting containing the Angular app and a subdomain pointing to the play server.
Any ideas/suggestions on where I should investigate?
allowedOriginsarray and not just example.com (assuming you are not the owner of example.com) :)