Interface CorsPreflightOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CorsPreflightOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:30.498Z")
@Stability(Stable)
public interface CorsPreflightOptions
extends software.amazon.jsii.JsiiSerializable
Options for the CORS Configuration.
Example:
HttpApi.Builder.create(this, "HttpProxyApi")
.corsPreflight(CorsPreflightOptions.builder()
.allowHeaders(List.of("Authorization"))
.allowMethods(List.of(CorsHttpMethod.GET, CorsHttpMethod.HEAD, CorsHttpMethod.OPTIONS, CorsHttpMethod.POST))
.allowOrigins(List.of("*"))
.maxAge(Duration.days(10))
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCorsPreflightOptionsstatic final classAn implementation forCorsPreflightOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic CorsPreflightOptions.Builderbuilder()default BooleanSpecifies whether credentials are included in the CORS request.Represents a collection of allowed headers.default List<CorsHttpMethod> Represents a collection of allowed HTTP methods.Represents a collection of allowed origins.Represents a collection of exposed headers.default DurationThe duration that the browser should cache preflight request results.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAllowCredentials
Specifies whether credentials are included in the CORS request.Default: false
-
getAllowHeaders
Represents a collection of allowed headers.Default: - No Headers are allowed.
-
getAllowMethods
Represents a collection of allowed HTTP methods.Default: - No Methods are allowed.
-
getAllowOrigins
Represents a collection of allowed origins.Default: - No Origins are allowed.
-
getExposeHeaders
Represents a collection of exposed headers.Default: - No Expose Headers are allowed.
-
getMaxAge
The duration that the browser should cache preflight request results.Default: Duration.seconds(0)
-
builder
- Returns:
- a
CorsPreflightOptions.BuilderofCorsPreflightOptions
-