public final class CorsConfig extends Object
CorsServiceBuilder,
CorsService.config()| Modifier and Type | Method and Description |
|---|---|
CorsPolicy |
getPolicy(String origin,
RoutingContext routingContext)
Returns the policy for the specified
origin. |
boolean |
isAnyOriginSupported()
Determines whether a wildcard origin, '*', is supported.
|
boolean |
isShortCircuit()
Determines whether a CORS request should be rejected if it's invalid before being
further processing.
|
List<CorsPolicy> |
policies()
Returns the policies.
|
String |
toString() |
public boolean isAnyOriginSupported()
true if any origin is allowed.public boolean isShortCircuit()
CORS headers are set after a request is processed. This may not always be desired and this setting will check that the Origin is valid and if it is not valid no further processing will take place, and a error will be returned to the calling client.
true if a CORS request should short-circuit upon receiving an invalid Origin header.public List<CorsPolicy> policies()
public CorsPolicy getPolicy(String origin, RoutingContext routingContext)
origin.CorsPolicy which allows the origin,
null if the origin is null or not allowed in any policy.Copyright © 2020 LeanCloud. All rights reserved.