Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CorsHandler

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

Hierarchy

  • CorsHandler

Implements

Index

Methods

addOrigin

  • Add an origin to the list of allowed Origins. An origin follows rfc6454#section-7 and is expected to have the format: "://" [ ":" ]

    Parameters

    • origin: string

    Returns CorsHandler

addOrigins

  • Set the list of allowed origins. An origin follows rfc6454#section-7 and is expected to have the format: "://" [ ":" ]

    Parameters

    • origins: string

    Returns CorsHandler

addRelativeOrigin

  • Add a relative origin to the list of allowed Origins. A relative origin is a regex that should match the format "://" [ ":" ].

    Parameters

    • origin: string

    Returns CorsHandler

addRelativeOrigins

  • Set the list of allowed relative origins. A relative origin is a regex that should match the format "://" [ ":" ].

    Parameters

    • origins: string

    Returns CorsHandler

allowCredentials

  • Set whether credentials are allowed. Note that user agents will block requests that use a wildcard as origin and include credentials.

    From the MDN documentation you can read:

    Important note: when responding to a credentialed request, server must specify a domain, and cannot use wild carding.

    Parameters

    • allow: boolean

    Returns CorsHandler

allowPrivateNetwork

  • Set whether access from public to private networks are allowed. Defaults to false

    Parameters

    • allow: boolean

    Returns CorsHandler

allowedHeader

  • Add an allowed header

    Parameters

    • headerName: string

    Returns CorsHandler

allowedHeaders

  • Add a set of allowed headers

    Parameters

    • headerNames: string

    Returns CorsHandler

allowedMethod

  • Add an allowed method

    Parameters

    • method: HttpMethod

    Returns CorsHandler

allowedMethods

  • Add a set of allowed methods

    Parameters

    • methods: HttpMethod

    Returns CorsHandler

exposedHeader

  • Add an exposed header

    Parameters

    • headerName: string

    Returns CorsHandler

exposedHeaders

  • Add a set of exposed headers

    Parameters

    • headerNames: string

    Returns CorsHandler

handle

maxAgeSeconds

  • Set how long the browser should cache the information

    Parameters

    • maxAgeSeconds: number

    Returns CorsHandler

Static create

  • Parameters

    • allowedOriginPattern: string

    Returns CorsHandler

  • Create a empty CORS handler that allows * origin.

    Returns CorsHandler

Generated using TypeDoc