Valer Micle created CXF-7561:
--------------------------------

             Summary: CrossOriginResourceSharing annotation on a super 
interface is not interpreted
                 Key: CXF-7561
                 URL: https://issues.apache.org/jira/browse/CXF-7561
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS Security
    Affects Versions: 3.1.14
            Reporter: Valer Micle


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:
{code}
@CrossOriginResourceSharing(
        allowAllOrigins = true,
        allowCredentials = true,
        maxAge = 1209600,
        allowHeaders = {"X-HTTP-Method-Override"},
        exposeHeaders = {"X-Total-Count"}
)
public interface CorsEnabledService {
}
{code}

and then I've extended on all my actual services this interface:
{code}
@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();
}
{code}

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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to