Skip to content

Cors

Source code in docs_src/capo_lambda/types/cors.py
class Cors(TypedDict, closed=True):
    allow_credentials: NotRequired[
        "capo_lambda.types.allow_credentials.AllowCredentials"
    ]
    """<p>Whether to allow cookies or other credentials in requests to your function URL. The default is <code>false</code>.</p>"""
    allow_headers: NotRequired["capo_lambda.types.headers_list.HeadersList"]
    """<p>The HTTP headers that origins can include in requests to your function URL. For example: <code>Date</code>, <code>Keep-Alive</code>, <code>X-Custom-Header</code>.</p>"""
    allow_methods: NotRequired["capo_lambda.types.allow_methods_list.AllowMethodsList"]
    """<p>The HTTP methods that are allowed when calling your function URL. For example: <code>GET</code>, <code>POST</code>, <code>DELETE</code>, or the wildcard character (<code>*</code>).</p>"""
    allow_origins: NotRequired["capo_lambda.types.allow_origins_list.AllowOriginsList"]
    """<p>The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: <code>https://www.example.com</code>, <code>http://localhost:60905</code>.</p> <p>Alternatively, you can grant access to all origins using the wildcard character (<code>*</code>).</p>"""
    expose_headers: NotRequired["capo_lambda.types.headers_list.HeadersList"]
    """<p>The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: <code>Date</code>, <code>Keep-Alive</code>, <code>X-Custom-Header</code>.</p>"""
    max_age: NotRequired["capo_lambda.types.max_age.MaxAge"]
    """<p>The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to <code>0</code>, which means that the browser doesn't cache results.</p>"""

allow_credentials instance-attribute

allow_credentials: NotRequired[AllowCredentials]

Whether to allow cookies or other credentials in requests to your function URL. The default is false.

allow_headers instance-attribute

allow_headers: NotRequired[HeadersList]

The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

allow_methods instance-attribute

allow_methods: NotRequired[AllowMethodsList]

The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

allow_origins instance-attribute

allow_origins: NotRequired[AllowOriginsList]

The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

Alternatively, you can grant access to all origins using the wildcard character (*).

expose_headers instance-attribute

expose_headers: NotRequired[HeadersList]

The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

max_age instance-attribute

max_age: NotRequired[MaxAge]

The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.