Skip to content

Commit 97428a2

Browse files
Merge pull request #1155 from NHSDigital/feature/ERSSUP-70260
[ERSSUP-70260]-[JW]-[Remove Strict-Transport-Security Header from San…
2 parents 3d8dc8e + 130041e commit 97428a2

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

sandbox/src/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const addCommonHeaders = function (request, response) {
1010
response.headers["X-Correlation-ID"] = request.headers["x-correlation-id"]
1111
}
1212
response.headers["X-Request-ID"] = '58621d65-d5ad-4c3a-959f-0438e355990e-1'
13-
response.headers["Strict-Transport-Security"] = 'max-age=864000; includeSubDomains'
1413
}
1514
}
1615

tests/asserts.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"connection": "keep-alive",
1616
"transfer-encoding": "chunked",
1717
"access-control-expose-headers": "x-correlation-id,x-request-id,content-type,Location,ETag,Content-Disposition,Content-Length,Cache-Control",
18-
"strict-transport-security": "max-age=864000; includeSubDomains",
1918
}
2019

2120
_generic_file_headers = {
@@ -26,7 +25,6 @@
2625
"accept-ranges": "bytes",
2726
"connection": "keep-alive",
2827
"access-control-expose-headers": "x-correlation-id,x-request-id,content-type,Location,ETag,Content-Disposition,Content-Length,Cache-Control",
29-
"strict-transport-security": "max-age=864000; includeSubDomains",
3028
}
3129

3230
_generic_upload_headers = {
@@ -37,15 +35,14 @@
3735
"connection": "keep-alive",
3836
"content-length": "0",
3937
"access-control-expose-headers": "x-correlation-id,x-request-id,content-type,Location,ETag,Content-Disposition,Content-Length,Cache-Control",
40-
"strict-transport-security": "max-age=864000; includeSubDomains",
4138
}
4239

4340
# Headers which should be ignored from validation. This should only be used when the value of a header cannot be accurately be predicted.
4441
# Note however the existance of these headers is still validated.
4542
_ignored_headers = ["Date", "last-modified"]
4643

4744
# Headers which should be excluded from validation entirely.
48-
_excluded_headers = ["Keep-Alive"]
45+
_excluded_headers = ["Keep-Alive", "Strict-Transport-Security"]
4946

5047
_HEADER_REQUEST_ID = "x-request-id"
5148
_HEADER_ERS_TRANSACTION_ID = "X_ERS_TRANSACTION_ID"
@@ -100,7 +97,12 @@ def assert_headers(
10097
"""
10198

10299
actual_headers = _lower_keys(
103-
dict(filter(_filter_header, response.headers.items(),))
100+
dict(
101+
filter(
102+
_filter_header,
103+
response.headers.items(),
104+
)
105+
)
104106
)
105107

106108
expected_headers = dict(generic_headers)
@@ -151,7 +153,12 @@ def assert_upload_response_headers(
151153
"""
152154

153155
actual_headers = _lower_keys(
154-
dict(filter(_filter_header, response.headers.items(),))
156+
dict(
157+
filter(
158+
_filter_header,
159+
response.headers.items(),
160+
)
161+
)
155162
)
156163

157164
expected_headers = dict(_generic_upload_headers)

0 commit comments

Comments
 (0)