Package io.vertx.mutiny.ext.web.handler
Class CorsHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.CorsHandler
- All Implemented Interfaces:
MutinyDelegate
,io.vertx.core.Handler<RoutingContext>
,SecurityPolicyHandler
,Consumer<RoutingContext>
public class CorsHandler
extends Object
implements MutinyDelegate, SecurityPolicyHandler, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
A handler which implements server side http://www.w3.org/TR/cors/[CORS] support for Vert.x-Web.
NOTE: This class has been automatically generated from the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCorsHandler
(io.vertx.ext.web.handler.CorsHandler delegate) CorsHandler
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(RoutingContext item) addOrigins
(List<String> origins) addRelativeOrigin
(String origin) addRelativeOrigins
(List<String> origins) allowCredentials
(boolean allow) allowedHeader
(String headerName) allowedHeaders
(Set<String> headerNames) allowedMethod
(io.vertx.core.http.HttpMethod method) allowedMethods
(Set<io.vertx.core.http.HttpMethod> methods) allowPrivateNetwork
(boolean allow) static CorsHandler
create()
static CorsHandler
Deprecated.patterns should use the relative origin method.boolean
exposedHeader
(String headerName) exposedHeaders
(Set<String> headerNames) io.vertx.ext.web.handler.CorsHandler
void
handle
(RoutingContext arg0) int
hashCode()
maxAgeSeconds
(int maxAgeSeconds) static CorsHandler
newInstance
(io.vertx.ext.web.handler.CorsHandler arg) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
CorsHandler
public CorsHandler(io.vertx.ext.web.handler.CorsHandler delegate) -
CorsHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.handler.CorsHandler getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Specified by:
getDelegate
in interfaceSecurityPolicyHandler
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
- Specified by:
handle
in interfaceSecurityPolicyHandler
-
create
Deprecated.patterns should use the relative origin method. Create a CORS handler using a regular expression to match origins. An origin follows rfc6454#section-7 and is expected to have the format:<scheme> "://" <hostname> [ ":" <port> ]
- Parameters:
allowedOriginPattern
- the allowed origin pattern- Returns:
- the handler
-
create
- Returns:
- the handler
-
addOrigin
- Parameters:
origin
- the well formatted static origin- Returns:
- self
-
addRelativeOrigins
- Parameters:
origins
- the well formatted relative origin list- Returns:
- self
-
addRelativeOrigin
- Parameters:
origin
- the well formatted static origin- Returns:
- self
-
addOrigins
- Parameters:
origins
- the well formatted static origin list- Returns:
- self
-
allowedMethod
- Parameters:
method
- the method to add- Returns:
- a reference to this, so the API can be used fluently
-
allowedMethods
- Parameters:
methods
- the methods to add- Returns:
- a reference to this, so the API can be used fluently
-
allowedHeader
- Parameters:
headerName
- the allowed header name- Returns:
- a reference to this, so the API can be used fluently
-
allowedHeaders
- Parameters:
headerNames
- the allowed header names- Returns:
- a reference to this, so the API can be used fluently
-
exposedHeader
- Parameters:
headerName
- the exposed header name- Returns:
- a reference to this, so the API can be used fluently
-
exposedHeaders
- Parameters:
headerNames
- the exposed header names- Returns:
- a reference to this, so the API can be used fluently
-
allowCredentials
- Parameters:
allow
- true if allowed- Returns:
- a reference to this, so the API can be used fluently
-
maxAgeSeconds
- Parameters:
maxAgeSeconds
- max age in seconds- Returns:
- a reference to this, so the API can be used fluently
-
allowPrivateNetwork
- Parameters:
allow
- true if allowed- Returns:
- a reference to this, so the API can be used fluently
-
accept
- Specified by:
accept
in interfaceConsumer<RoutingContext>
- Specified by:
accept
in interfaceSecurityPolicyHandler
-
newInstance
-