Package: io.vertx.groovy.ext.web.handler

## [Groovy] Class CorsHandler

- io.vertx.groovy.ext.web.handler.CorsHandler

- All Implemented Interfaces and Traits:
    io.vertx.core.Handler

      @groovy.transform.CompileStatic
      class CorsHandler
      extends java.lang.Object

  A handler which implements server side http://www.w3.org/TR/cors/[CORS] support for Vert.x-Web.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `CorsHandler (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `CorsHandler` | `allowCredentials(boolean allow)` Set whether credentials are allowed
    `CorsHandler` | `allowedHeader(java.lang.String headerName)` Add an allowed header
    `CorsHandler` | `allowedHeaders(java.util.Set<java.lang.String> headerNames)` Add a set of allowed headers
    `CorsHandler` | `allowedMethod(io.vertx.core.http.HttpMethod method)` Add an allowed method
    `static CorsHandler` | `create(java.lang.String allowedOriginPattern)` Create a CORS handler
    `CorsHandler` | `exposedHeader(java.lang.String headerName)` Add an exposed header
    `CorsHandler` | `exposedHeaders(java.util.Set<java.lang.String> headerNames)` Add a set of exposed headers
    `java.lang.Object` | `getDelegate()`
    `void` | `handle(RoutingContext arg0)`
    `CorsHandler` | `maxAgeSeconds(int maxAgeSeconds)` Set how long the browser should cache the information

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### CorsHandler(java.lang.Object delegate)

  - ### Method Detail

    - #### CorsHandler allowCredentials(boolean allow)

      Set whether credentials are allowed

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `allow` - true if allowed

    - #### CorsHandler allowedHeader(java.lang.String headerName)

      Add an allowed header

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `headerName` - the allowed header name

    - #### CorsHandler allowedHeaders(java.util.Set<java.lang.String> headerNames)

      Add a set of allowed headers

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `headerNames` - the allowed header names

    - #### CorsHandler allowedMethod(io.vertx.core.http.HttpMethod method)

      Add an allowed method

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `method` - the method to add

    - #### static CorsHandler create(java.lang.String allowedOriginPattern)

      Create a CORS handler

      Returns:
        the handler
      Parameters:
        `allowedOriginPattern` - the allowed origin pattern

    - #### CorsHandler exposedHeader(java.lang.String headerName)

      Add an exposed header

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `headerName` - the exposed header name

    - #### CorsHandler exposedHeaders(java.util.Set<java.lang.String> headerNames)

      Add a set of exposed headers

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `headerNames` - the exposed header names

    - #### java.lang.Object getDelegate()

    - #### void handle(RoutingContext arg0)

    - #### CorsHandler maxAgeSeconds(int maxAgeSeconds)

      Set how long the browser should cache the information

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `maxAgeSeconds` - max age in seconds