Annotation Type CorsDecorator


@Repeatable(CorsDecorators.class)
@Retention(RUNTIME)
@Target({TYPE,METHOD})
public @interface CorsDecorator
A CorsService decorator for annotated HTTP services.
  • Required Element Summary

    Required Elements 
    Modifier and Type Required Element Description
    String[] origins
    Allowed origins.
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    String[] allowedRequestHeaders
    The headers that should be returned in the CORS "Access-Control-Allow-Headers" response header.
    HttpMethod[] allowedRequestMethods
    The allowed HTTP request methods that should be returned in the CORS "Access-Control-Allow-Methods" response header.
    boolean credentialsAllowed
    Determines if cookies are allowed to be added to CORS requests.
    String[] exposedHeaders
    The headers to be exposed to calling clients.
    long maxAge
    The value of the CORS "Access-Control-Max-Age" response header which enables the caching of the preflight response for the specified time.
    boolean nullOriginAllowed
    Determines if a "null" origin is allowed.
    String[] pathPatterns
    The path patterns that this policy is supposed to be applied to.
    boolean preflightRequestDisabled
    Determines if no preflight response headers should be added to a CORS preflight response.
    AdditionalHeader[] preflightRequestHeaders
    The HTTP response headers that should be added to a CORS preflight response.