Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1.14
-
None
-
Novice
Description
Hi,
I have multiple endpoints and I would like to apply the same CORS configuration for all services.
What I've done is to create a root interface like this:
@CrossOriginResourceSharing( allowAllOrigins = true, allowCredentials = true, maxAge = 1209600, allowHeaders = {"X-HTTP-Method-Override"}, exposeHeaders = {"X-Total-Count"} ) public interface CorsEnabledService { }
and then I've extended on all my actual services this interface:
@Path("/example1") public interface ExampleService extends CorsEnabledService { @GET @Path("/") @Produces({MediaType.APPLICATION_JSON}) Response getResults(); } @Path("/example2") public interface SecondExampleService extends CorsEnabledService { @GET @Path("/") @Produces({MediaType.APPLICATION_JSON}) Response getSecondResults(); }
This is not working and I have to duplicate the cors related annotation everywhere.
Isn't this supposed to work? It will be awesome to have it working.
I see this as a bug since defining common annotations is quite a common practice and I would expect this to work.