public class CorsHandler extends Object implements SecurityPolicyHandler, 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 | 
addOrigin(String origin)
Add an origin to the list of allowed Origins. 
 | 
CorsHandler | 
addOrigins(List<String> origins)
Set the list of allowed origins. 
 | 
CorsHandler | 
addRelativeOrigin(String origin)
Add a relative origin to the list of allowed Origins. 
 | 
CorsHandler | 
addRelativeOrigins(List<String> origins)
Set the list of allowed relative origins. 
 | 
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 
 | 
CorsHandler | 
allowPrivateNetwork(boolean allow)
Set whether access from public to private networks are allowed. 
 | 
static CorsHandler | 
create()
Create a empty CORS handler that allows  
* origin. | 
static CorsHandler | 
create(String allowedOriginPattern)
Deprecated.  
 | 
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()  | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitnewInstancepublic static final io.vertx.lang.rx.TypeArg<CorsHandler> __TYPE_ARG
public CorsHandler(CorsHandler delegate)
public CorsHandler(Object delegate)
public CorsHandler getDelegate()
getDelegate in interface SecurityPolicyHandlerpublic void handle(RoutingContext event)
handle in interface Handler<RoutingContext>handle in interface SecurityPolicyHandlerevent - the event to handle@Deprecated public static CorsHandler create(String allowedOriginPattern)
allowedOriginPattern - the allowed origin patternpublic static CorsHandler create()
* origin.public CorsHandler addOrigin(String origin)
 "://"  [ ":"  ]   origin - the well formatted static originpublic CorsHandler addRelativeOrigins(List<String> origins)
 "://"  [ ":"  ]   .origins - the well formatted relative origin listpublic CorsHandler addRelativeOrigin(String origin)
 "://"  [ ":"  ]   .origin - the well formatted static originpublic CorsHandler addOrigins(List<String> origins)
 "://"  [ ":"  ]   origins - the well formatted static origin listpublic 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 CorsHandler allowPrivateNetwork(boolean allow)
allow - true if allowedpublic static CorsHandler newInstance(CorsHandler arg)
Copyright © 2023 Eclipse. All rights reserved.