Skip to content

Commit a88e908

Browse files
Add information about response headers policies
1 parent 68f0a89 commit a88e908

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

add-security-headers/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Add HTTP security headers
22

3+
> :warning: Consider using [CloudFront Response Headers Policies](https://aws.amazon.com/blogs/networking-and-content-delivery/amazon-cloudfront-introduces-response-headers-policies/) instead of CloudFront Functions to configure CORS, security, and custom HTTP response headers.
4+
35
**CloudFront Functions event type: viewer response**
46

57
This function adds several common HTTP security headers to the response from CloudFront. The following headers are added as part of this function:
@@ -42,4 +44,4 @@ If the function has been set up correctly, you should see a result similar to th
4244
"FunctionOutput": "{\"response\":{\"headers\":{\"server\":{\"value\":\"CustomOriginServer\"},\"content-length\":{\"value\":\"9593\"},\"content-security-policy\":{\"value\":\"default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'\"},\"x-content-type-options\":{\"value\":\"nosniff\"},\"x-xss-protection\":{\"value\":\"1; mode=block\"},\"x-frame-options\":{\"value\":\"DENY\"},\"content-type\":{\"value\":\"text/html; charset=UTF-8\"},\"strict-transport-security\":{\"value\":\"max-age=63072000; includeSubdomains; preload\"}},\"statusDescription\":\"OK\",\"cookies\":{\"loggedIn\":{\"attributes\":\"Secure; Path=/; Domain=example.com; Expires=Wed, 05 Jan 2024 07:28:00 GMT\",\"value\":\"true\"},\"id\":{\"attributes\":\"Expires=Wed, 05 Jan 2024 07:28:00 GMT\",\"value\":\"a3fWa\"}},\"statusCode\":200}}"
4345
}
4446
}
45-
```
47+
```

0 commit comments

Comments
 (0)