Class CorsPolicy
Enable CORS (Cross-Origin-Resource-Sharing) request handling.
Inherited Members
Namespace: Oci.ApigatewayService.Models
Assembly: OCI.DotNetSDK.Apigateway.dll
Syntax
public class CorsPolicy
Properties
AllowedHeaders
Declaration
[JsonProperty(PropertyName = "allowedHeaders")]
public List<string> AllowedHeaders { get; set; }
Property Value
Type | Description |
---|---|
List<string> | The list of headers that will be allowed from the client via the Access-Control-Allow-Headers header. '*' will allow all headers. |
AllowedMethods
Declaration
[JsonProperty(PropertyName = "allowedMethods")]
public List<string> AllowedMethods { get; set; }
Property Value
Type | Description |
---|---|
List<string> | 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. |
AllowedOrigins
Declaration
[Required(ErrorMessage = "AllowedOrigins is required.")]
[JsonProperty(PropertyName = "allowedOrigins")]
public List<string> AllowedOrigins { get; set; }
Property Value
Type | Description |
---|---|
List<string> | 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. |
Remarks
Required
ExposedHeaders
Declaration
[JsonProperty(PropertyName = "exposedHeaders")]
public List<string> ExposedHeaders { get; set; }
Property Value
Type | Description |
---|---|
List<string> | 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. |
IsAllowCredentialsEnabled
Declaration
[JsonProperty(PropertyName = "isAllowCredentialsEnabled")]
public bool? IsAllowCredentialsEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool? | Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies. |
MaxAgeInSeconds
Declaration
[JsonProperty(PropertyName = "maxAgeInSeconds")]
public int? MaxAgeInSeconds { get; set; }
Property Value
Type | Description |
---|---|
int? | The time in seconds for the client to cache preflight responses. This is sent as the Access-Control-Max-Age if greater than 0. |