Annotation Type CrossOrigin


  • @Documented
    @Inherited
    @Retention(RUNTIME)
    @Target({TYPE,METHOD})
    public @interface CrossOrigin
    Support CORs configuration via annotation. For example, it will enable Micronaut developers only to allow CORS for a few routes in their applications. Thus, having more secure applications.
    Since:
    3.9.0
    • Element Detail

      • value

        @AliasFor(member="allowedOrigins")
        java.lang.String[] value
        Returns:
        the origins for which cross-origin requests are allowed
        Default:
        {}
      • allowedOrigins

        @AliasFor(member="value")
        java.lang.String[] allowedOrigins
        Returns:
        the origins for which cross-origin requests are allowed
        Default:
        {}
      • allowedOriginsRegex

        java.lang.String allowedOriginsRegex
        Returns:
        regular expression to match allowed origins
        Default:
        ""
      • allowedHeaders

        java.lang.String[] allowedHeaders
        Returns:
        request headers permitted in requests
        Default:
        {}
      • exposedHeaders

        java.lang.String[] exposedHeaders
        Returns:
        response headers that user-agent will allow client to access on actual response
        Default:
        {}
      • allowedMethods

        io.micronaut.http.HttpMethod[] allowedMethods
        Returns:
        supported HTTP request methods
        Default:
        {}
      • allowCredentials

        boolean allowCredentials
        Returns:
        whether the browser should send credentials
        Default:
        true
      • maxAge

        long maxAge
        Returns:
        maximum age (in seconds) of the cache duration for preflight responses
        Default:
        1800L