public class CorsHandler extends Object implements Handler<RoutingContext>
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<CorsHandler> |
__TYPE_ARG |
Constructor and Description |
---|
CorsHandler(CorsHandler delegate) |
CorsHandler(Object delegate) |
Modifier and Type | Method 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
|
CorsHandler |
allowedMethods(Set<HttpMethod> methods)
Add a set of allowed methods
|
static CorsHandler |
create(String allowedOriginPattern)
Create a CORS handler
|
boolean |
equals(Object o) |
CorsHandler |
exposedHeader(String headerName)
Add an exposed header
|
CorsHandler |
exposedHeaders(Set<String> headerNames)
Add a set of exposed headers
|
CorsHandler |
getDelegate() |
void |
handle(RoutingContext event)
Something has happened, so handle it.
|
int |
hashCode() |
CorsHandler |
maxAgeSeconds(int maxAgeSeconds)
Set how long the browser should cache the information
|
static CorsHandler |
newInstance(CorsHandler arg) |
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<CorsHandler> __TYPE_ARG
public CorsHandler(CorsHandler delegate)
public CorsHandler(Object delegate)
public CorsHandler getDelegate()
public void handle(RoutingContext event)
handle
in interface Handler<RoutingContext>
event
- the event to handlepublic static CorsHandler create(String allowedOriginPattern)
allowedOriginPattern
- the allowed origin patternpublic CorsHandler allowedMethod(HttpMethod method)
method
- the method to addpublic CorsHandler allowedMethods(Set<HttpMethod> methods)
methods
- the methods to addpublic CorsHandler allowedHeader(String headerName)
headerName
- the allowed header namepublic CorsHandler allowedHeaders(Set<String> headerNames)
headerNames
- the allowed header namespublic CorsHandler exposedHeader(String headerName)
headerName
- the exposed header namepublic CorsHandler exposedHeaders(Set<String> headerNames)
headerNames
- the exposed header namespublic CorsHandler allowCredentials(boolean allow)
Important note: when responding to a credentialed request, server must specify a domain, and cannot use wild carding.
allow
- true if allowedpublic CorsHandler maxAgeSeconds(int maxAgeSeconds)
maxAgeSeconds
- max age in secondspublic static CorsHandler newInstance(CorsHandler arg)
Copyright © 2023 Eclipse. All rights reserved.