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

## [Groovy] Class CorsHandler

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

- All Implemented Interfaces and Traits:
    Handler

      @CompileStatic
      class CorsHandler

  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 (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `CorsHandler` | `allowCredentials(boolean allow)` Set whether credentials are allowed
    `CorsHandler` | `allowedHeader(String headerName)` Add an allowed header
    `CorsHandler` | `allowedHeaders(Set<String> headerNames)` Add a set of allowed headers
    `CorsHandler` | `allowedMethod(HttpMethod method)` Add an allowed method
    `static CorsHandler` | `create(String allowedOriginPattern)` Create a CORS handler
    `CorsHandler` | `exposedHeader(String headerName)` Add an exposed header
    `CorsHandler` | `exposedHeaders(Set<String> headerNames)` Add a set of exposed headers
    `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 Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### CorsHandler(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(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(Set<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(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(String allowedOriginPattern)

      Create a CORS handler

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

    - #### CorsHandler exposedHeader(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(Set<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

    - #### 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