Skip to content

Commit 252eaa1

Browse files
committed
2 parents 235466d + 8328563 commit 252eaa1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

terraform/browser/add_response_security_headers.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ function handler(event) {
66
var headers = response.headers;
77

88
// Set HTTP security headers
9-
// Since JavaScript doesn't allow for hyphens in variable names, we use the dict["key"] notation
10-
headers['strict-transport-security'] = { value: 'max-age=63072000; includeSubdomains; preload'};
11-
// headers['content-security-policy'] = { value: "default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'"};
12-
// headers['x-content-type-options'] = { value: 'nosniff'};
13-
// headers['x-frame-options'] = {value: 'DENY'};
14-
// headers['x-xss-protection'] = {value: '1; mode=block'};
9+
// Since JavaScript doesn't allow for hyphens in variable names, we use the
10+
// dict['key'] notation
11+
headers['strict-transport-security'] = {
12+
value: 'max-age=63072000; includeSubdomains; preload'
13+
};
14+
headers['x-content-type-options'] = { value: 'nosniff' };
15+
headers['x-frame-options'] = { value: 'DENY' };
16+
headers['x-xss-protection'] = { value: '1; mode=block' };
1517

1618
// Return the response to viewers
1719
return response;

0 commit comments

Comments
 (0)