Package com.linecorp.armeria.server.cors
Class CorsConfig
java.lang.Object
com.linecorp.armeria.server.cors.CorsConfig
Cross-Origin Resource Sharing
(CORS) configuration.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetPolicy
(@Nullable String origin, RoutingContext routingContext) Returns the policy for the specifiedorigin
.boolean
Determines whether a wildcard origin, '*', is supported.boolean
Determines whether a CORS request should be rejected if it's invalid before being further processing.policies()
Returns the policies.toString()
-
Method Details
-
isAnyOriginSupported
public boolean isAnyOriginSupported()Determines whether a wildcard origin, '*', is supported.- Returns:
true
if any origin is allowed.
-
isShortCircuit
public boolean isShortCircuit()Determines whether a CORS request should be rejected if it's invalid before being further processing.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.
- Returns:
true
if a CORS request should short-circuit upon receiving an invalid Origin header.
-
policies
Returns the policies. -
getPolicy
@Nullable public @Nullable CorsPolicy getPolicy(@Nullable @Nullable String origin, RoutingContext routingContext) Returns the policy for the specifiedorigin
.- Returns:
CorsPolicy
which allows theorigin
,null
if theorigin
isnull
or not allowed in any policy.
-
toString
-