You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2017/11/14 10:43:00 UTC
[jira] [Updated] (CXF-7561) CrossOriginResourceSharing annotation
on a super interface is not interpreted
[ https://issues.apache.org/jira/browse/CXF-7561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin updated CXF-7561:
----------------------------------
Fix Version/s: 3.2.2
3.1.15
> 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
> Fix For: 3.1.15, 3.2.2
>
>
> 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)