io.undertow.server.handlers

## Class OriginHandler

- java.lang.Object
- - io.undertow.server.handlers.OriginHandler

All Implemented Interfaces:
  HttpHandler

    public class OriginHandler
    extends Object
    implements HttpHandler

A handler for the HTTP Origin (RFC 6454) header.

Author:
  Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`OriginHandler()`

### Method Summary

All Methods Instance Methods Concrete Methods
`OriginHandler` `addAllowedOrigin(String origin)`
`OriginHandler` `addAllowedOrigins(Collection<String> origins)`
`OriginHandler` `addAllowedOrigins(String... origins)`
`OriginHandler` `clearAllowedOrigins()`
`Set<String>` `getAllowedOrigins()`
`HttpHandler` `getNext()`
`HttpHandler` `getOriginFailedHandler()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`boolean` `isRequireAllOrigins()`
`boolean` `isRequireOriginHeader()`
`OriginHandler` `setNext(HttpHandler next)`
`OriginHandler` `setOriginFailedHandler(HttpHandler originFailedHandler)`
`OriginHandler` `setRequireAllOrigins(boolean requireAllOrigins)`
`OriginHandler` `setRequireOriginHeader(boolean requireOriginHeader)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OriginHandler

    public OriginHandler()

### Method Detail

#### handleRequest

    public void handleRequest(HttpServerExchange exchange)
                       throws Exception

Description copied from interface: `HttpHandler`
Handle the request.

Specified by:
  `handleRequest` in interface `HttpHandler`
Parameters:
  `exchange` - the HTTP request/response exchange
Throws:
  `Exception`

#### addAllowedOrigin

    public OriginHandler addAllowedOrigin(String origin)

#### addAllowedOrigins

    public OriginHandler addAllowedOrigins(Collection<String> origins)

#### addAllowedOrigins

    public OriginHandler addAllowedOrigins(String... origins)

#### getAllowedOrigins

    public Set<String> getAllowedOrigins()

#### clearAllowedOrigins

    public OriginHandler clearAllowedOrigins()

#### isRequireAllOrigins

    public boolean isRequireAllOrigins()

#### setRequireAllOrigins

    public OriginHandler setRequireAllOrigins(boolean requireAllOrigins)

#### isRequireOriginHeader

    public boolean isRequireOriginHeader()

#### setRequireOriginHeader

    public OriginHandler setRequireOriginHeader(boolean requireOriginHeader)

#### getNext

    public HttpHandler getNext()

#### setNext

    public OriginHandler setNext(HttpHandler next)

#### getOriginFailedHandler

    public HttpHandler getOriginFailedHandler()

#### setOriginFailedHandler

    public OriginHandler setOriginFailedHandler(HttpHandler originFailedHandler)