Class CorsPreflightOptions
(experimental) Options for the CORS Configuration.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.APIGatewayv2
Assembly: Amazon.CDK.AWS.APIGatewayv2.dll
Syntax (csharp)
public class CorsPreflightOptions : Object, ICorsPreflightOptions
Syntax (vb)
Public Class CorsPreflightOptions
Inherits Object
Implements ICorsPreflightOptions
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
new HttpApi(this, "HttpProxyApi", new HttpApiProps {
CorsPreflight = new CorsPreflightOptions {
AllowHeaders = new [] { "Authorization" },
AllowMethods = new [] { CorsHttpMethod.GET, CorsHttpMethod.HEAD, CorsHttpMethod.OPTIONS, CorsHttpMethod.POST },
AllowOrigins = new [] { "*" },
MaxAge = Duration.Days(10)
}
});
Synopsis
Constructors
CorsPreflightOptions() |
Properties
AllowCredentials | (experimental) Specifies whether credentials are included in the CORS request. |
AllowHeaders | (experimental) Represents a collection of allowed headers. |
AllowMethods | (experimental) Represents a collection of allowed HTTP methods. |
AllowOrigins | (experimental) Represents a collection of allowed origins. |
ExposeHeaders | (experimental) Represents a collection of exposed headers. |
MaxAge | (experimental) The duration that the browser should cache preflight request results. |
Constructors
CorsPreflightOptions()
public CorsPreflightOptions()
Properties
AllowCredentials
(experimental) Specifies whether credentials are included in the CORS request.
public Nullable<bool> AllowCredentials { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Stability: Experimental
AllowHeaders
(experimental) Represents a collection of allowed headers.
public string[] AllowHeaders { get; set; }
Property Value
System.String[]
Remarks
Default: - No Headers are allowed.
Stability: Experimental
AllowMethods
(experimental) Represents a collection of allowed HTTP methods.
public CorsHttpMethod[] AllowMethods { get; set; }
Property Value
Remarks
Default: - No Methods are allowed.
Stability: Experimental
AllowOrigins
(experimental) Represents a collection of allowed origins.
public string[] AllowOrigins { get; set; }
Property Value
System.String[]
Remarks
Default: - No Origins are allowed.
Stability: Experimental
ExposeHeaders
(experimental) Represents a collection of exposed headers.
public string[] ExposeHeaders { get; set; }
Property Value
System.String[]
Remarks
Default: - No Expose Headers are allowed.
Stability: Experimental
MaxAge
(experimental) The duration that the browser should cache preflight request results.
public Duration MaxAge { get; set; }
Property Value
Remarks
Default: Duration.seconds(0)
Stability: Experimental