Interface CorsPreflightOptions

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.238Z") @Stability(Experimental) public interface CorsPreflightOptions extends software.amazon.jsii.JsiiSerializable
(experimental) 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(Experimental) @Nullable default Boolean getAllowCredentials()
      (experimental) Specifies whether credentials are included in the CORS request.

      Default: false

    • getAllowHeaders

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

      Default: - No Headers are allowed.

    • getAllowMethods

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

      Default: - No Methods are allowed.

    • getAllowOrigins

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

      Default: - No Origins are allowed.

    • getExposeHeaders

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

      Default: - No Expose Headers are allowed.

    • getMaxAge

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

      Default: Duration.seconds(0)

    • builder

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