public final class CorsService extends SimpleDecoratingHttpService
HttpService to add the
Cross-Origin Resource Sharing
(CORS) support.CorsServiceBuilder| Constructor and Description |
|---|
CorsService(HttpService delegate,
CorsConfig config)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static CorsServiceBuilder |
builder(Iterable<String> origins)
Returns a new
CorsServiceBuilder with the specified origins. |
static CorsServiceBuilder |
builder(String... origins)
Returns a new
CorsServiceBuilder with the specified origins. |
static CorsServiceBuilder |
builderForAnyOrigin()
Returns a new
CorsServiceBuilder with its origin set with "*" (any origin). |
CorsConfig |
config()
Returns the
CorsConfig. |
HttpResponse |
serve(ServiceRequestContext ctx,
HttpRequest req)
Serves an incoming
Request. |
serviceAdded, shouldCachePathas, delegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdecorate, decorateas, decorate, serviceAdded, shouldCachePath@Deprecated public CorsService(HttpService delegate, CorsConfig config)
builder(String...) or builderForAnyOrigin().CorsService that decorates the specified delegate to add CORS support.public static CorsServiceBuilder builderForAnyOrigin()
CorsServiceBuilder with its origin set with "*" (any origin).public static CorsServiceBuilder builder(String... origins)
CorsServiceBuilder with the specified origins.public static CorsServiceBuilder builder(Iterable<String> origins)
CorsServiceBuilder with the specified origins.public CorsConfig config()
CorsConfig.public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception
ServiceRequest.Copyright © 2020 LeanCloud. All rights reserved.