Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data Cors = Cors' {
- allowCredentials :: Maybe Bool
- allowHeaders :: Maybe [Text]
- allowMethods :: Maybe [Text]
- allowOrigins :: Maybe [Text]
- exposeHeaders :: Maybe [Text]
- maxAge :: Maybe Natural
- newCors :: Cors
- cors_allowCredentials :: Lens' Cors (Maybe Bool)
- cors_allowHeaders :: Lens' Cors (Maybe [Text])
- cors_allowMethods :: Lens' Cors (Maybe [Text])
- cors_allowOrigins :: Lens' Cors (Maybe [Text])
- cors_exposeHeaders :: Lens' Cors (Maybe [Text])
- cors_maxAge :: Lens' Cors (Maybe Natural)
Documentation
The cross-origin resource sharing (CORS) settings for your Lambda function URL. Use CORS to grant access to your function URL from any origin. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL.
See: newCors
smart constructor.
Cors' | |
|
Instances
Create a value of Cors
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:allowCredentials:Cors'
, cors_allowCredentials
- Whether to allow cookies or other credentials in requests to your
function URL. The default is false
.
$sel:allowHeaders:Cors'
, cors_allowHeaders
- The HTTP headers that origins can include in requests to your function
URL. For example: Date
, Keep-Alive
, X-Custom-Header
.
$sel:allowMethods:Cors'
, cors_allowMethods
- The HTTP methods that are allowed when calling your function URL. For
example: GET
, POST
, DELETE
, or the wildcard character (*
).
$sel:allowOrigins:Cors'
, cors_allowOrigins
- 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 (*
).
$sel:exposeHeaders:Cors'
, cors_exposeHeaders
- 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
.
$sel:maxAge:Cors'
, cors_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.
cors_allowCredentials :: Lens' Cors (Maybe Bool) Source #
Whether to allow cookies or other credentials in requests to your
function URL. The default is false
.
cors_allowHeaders :: Lens' Cors (Maybe [Text]) Source #
The HTTP headers that origins can include in requests to your function
URL. For example: Date
, Keep-Alive
, X-Custom-Header
.
cors_allowMethods :: Lens' Cors (Maybe [Text]) Source #
The HTTP methods that are allowed when calling your function URL. For
example: GET
, POST
, DELETE
, or the wildcard character (*
).
cors_allowOrigins :: Lens' Cors (Maybe [Text]) Source #
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 (*
).