Interface CorsPreflightOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CorsPreflightOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:12.043Z") @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();
 
  • Method Details

    • getAllowCredentials

      @Stability(Stable) @Nullable default Boolean getAllowCredentials()
      Specifies whether credentials are included in the CORS request.

      Default: false

    • getAllowHeaders

      @Stability(Stable) @Nullable default List<String> getAllowHeaders()
      Represents a collection of allowed headers.

      Default: - No Headers are allowed.

    • getAllowMethods

      @Stability(Stable) @Nullable default List<CorsHttpMethod> getAllowMethods()
      Represents a collection of allowed HTTP methods.

      Default: - No Methods are allowed.

    • getAllowOrigins

      @Stability(Stable) @Nullable default List<String> getAllowOrigins()
      Represents a collection of allowed origins.

      Default: - No Origins are allowed.

    • getExposeHeaders

      @Stability(Stable) @Nullable default List<String> getExposeHeaders()
      Represents a collection of exposed headers.

      Default: - No Expose Headers are allowed.

    • getMaxAge

      @Stability(Stable) @Nullable default Duration getMaxAge()
      The duration that the browser should cache preflight request results.

      Default: Duration.seconds(0)

    • builder

      @Stability(Stable) static CorsPreflightOptions.Builder builder()
      Returns:
      a CorsPreflightOptions.Builder of CorsPreflightOptions