Handle AWS CloudFront request and response headers.
For more documentation see working with policies in AWS CloudFront developer guide .
Append multiple headers to the exising headers dictionary
headers : { headers : Headers } -> { headers : Headers }
headers =
withHeaders
[ { key = "x-frame-options", value = "DENY" }
, { key = "content-security-policy", value = "default-src 'self';" }
]A single header is defined as key value type
header : Header
header =
{ key = "user-agent", value = "Amazon CloudFront" }A group of headers are defined as a dictionary of key -> key value type
header : Headers
header =
Dict.singleton "user-agent" [ { key = "user-agent", value = "Amazon CloudFront" } ]
headers : Headers
headers =
Dict.fromList
[ ( "user-agent", [ { key = "user-agent", value = "Amazon CloudFront" } ] )
, ( "host", [ { key = "host", value = "example.org" } ] )
]
Append a new header to the existing headers dictionary