public class CorsHandlerImpl extends Object implements CorsHandler
| Constructor and Description |
|---|
CorsHandlerImpl(String allowedOriginPattern) |
| 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
|
CorsHandler |
exposedHeader(String headerName)
Add an exposed header
|
CorsHandler |
exposedHeaders(Set<String> headerNames)
Add a set of exposed headers
|
void |
handle(RoutingContext context)
Something has happened, so handle it.
|
CorsHandler |
maxAgeSeconds(int maxAgeSeconds)
Set how long the browser should cache the information
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic CorsHandlerImpl(String allowedOriginPattern)
public CorsHandler allowedMethod(HttpMethod method)
CorsHandlerallowedMethod in interface CorsHandlermethod - the method to addpublic CorsHandler allowedMethods(Set<HttpMethod> methods)
CorsHandlerallowedMethods in interface CorsHandlermethods - the methods to addpublic CorsHandler allowedHeader(String headerName)
CorsHandlerallowedHeader in interface CorsHandlerheaderName - the allowed header namepublic CorsHandler allowedHeaders(Set<String> headerNames)
CorsHandlerallowedHeaders in interface CorsHandlerheaderNames - the allowed header namespublic CorsHandler exposedHeader(String headerName)
CorsHandlerexposedHeader in interface CorsHandlerheaderName - the exposed header namepublic CorsHandler exposedHeaders(Set<String> headerNames)
CorsHandlerexposedHeaders in interface CorsHandlerheaderNames - the exposed header namespublic CorsHandler allowCredentials(boolean allow)
CorsHandlerImportant note: when responding to a credentialed request, server must specify a domain, and cannot use wild carding.
allowCredentials in interface CorsHandlerallow - true if allowedpublic CorsHandler maxAgeSeconds(int maxAgeSeconds)
CorsHandlermaxAgeSeconds in interface CorsHandlermaxAgeSeconds - max age in secondspublic void handle(RoutingContext context)
Handlerhandle in interface Handler<RoutingContext>context - the event to handleCopyright © 2020. All rights reserved.