@Generated(value="OracleSDKGenerator", comments="API Version: 20190501") public final class CorsPolicy extends Object
Enable CORS (Cross-Origin-Resource-Sharing) request handling.
CorsPolicy.Builder
. This model distinguishes fields
that are null
because they are unset from fields that are explicitly set to null
. This is done in
the setter methods of the CorsPolicy.Builder
, which maintain a set of all explicitly set fields called
__explicitlySet__
. The hashCode()
and equals(Object)
methods are implemented to take
__explicitlySet__
into account. The constructor, on the other hand, does not set __explicitlySet__
(since the constructor cannot distinguish explicit null
from unset null
).Modifier and Type | Class and Description |
---|---|
static class |
CorsPolicy.Builder |
Constructor and Description |
---|
CorsPolicy(List<String> allowedOrigins,
List<String> allowedMethods,
List<String> allowedHeaders,
List<String> exposedHeaders,
Boolean isAllowCredentialsEnabled,
Integer maxAgeInSeconds)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static CorsPolicy.Builder |
builder()
Create a new builder.
|
boolean |
equals(Object o) |
Set<String> |
get__explicitlySet__() |
List<String> |
getAllowedHeaders()
The list of headers that will be allowed from the client via the Access-Control-Allow-Headers header.
|
List<String> |
getAllowedMethods()
The list of allowed HTTP methods that will be returned for the preflight OPTIONS request in the
Access-Control-Allow-Methods header.
|
List<String> |
getAllowedOrigins()
The list of allowed origins that the CORS handler will use to respond to CORS requests.
|
List<String> |
getExposedHeaders()
The list of headers that the client will be allowed to see from the response as indicated by the
Access-Control-Expose-Headers header.
|
Boolean |
getIsAllowCredentialsEnabled()
Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies.
|
Integer |
getMaxAgeInSeconds()
The time in seconds for the client to cache preflight responses.
|
int |
hashCode() |
CorsPolicy.Builder |
toBuilder() |
String |
toString() |
@ConstructorProperties(value={"allowedOrigins","allowedMethods","allowedHeaders","exposedHeaders","isAllowCredentialsEnabled","maxAgeInSeconds"}) @Deprecated public CorsPolicy(List<String> allowedOrigins, List<String> allowedMethods, List<String> allowedHeaders, List<String> exposedHeaders, Boolean isAllowCredentialsEnabled, Integer maxAgeInSeconds)
public static CorsPolicy.Builder builder()
Create a new builder.
public CorsPolicy.Builder toBuilder()
public List<String> getAllowedOrigins()
The list of allowed origins that the CORS handler will use to respond to CORS requests. The gateway will send the Access-Control-Allow-Origin header with the best origin match for the circumstances. ‘*’ will match any origins, and ‘null’ will match queries from ‘file:’ origins. All other origins must be qualified with the scheme, full hostname, and port if necessary.
public List<String> getAllowedMethods()
The list of allowed HTTP methods that will be returned for the preflight OPTIONS request in the Access-Control-Allow-Methods header. ‘*’ will allow all methods.
public List<String> getAllowedHeaders()
The list of headers that will be allowed from the client via the Access-Control-Allow-Headers header. ‘*’ will allow all headers.
public List<String> getExposedHeaders()
The list of headers that the client will be allowed to see from the response as indicated by the Access-Control-Expose-Headers header. ‘*’ will expose all headers.
public Boolean getIsAllowCredentialsEnabled()
Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies.
public Integer getMaxAgeInSeconds()
The time in seconds for the client to cache preflight responses. This is sent as the Access-Control-Max-Age if greater than 0.
Copyright © 2016–2021. All rights reserved.