|
15 | 15 | "connection": "keep-alive", |
16 | 16 | "transfer-encoding": "chunked", |
17 | 17 | "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", |
19 | 18 | } |
20 | 19 |
|
21 | 20 | _generic_file_headers = { |
|
26 | 25 | "accept-ranges": "bytes", |
27 | 26 | "connection": "keep-alive", |
28 | 27 | "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", |
30 | 28 | } |
31 | 29 |
|
32 | 30 | _generic_upload_headers = { |
|
37 | 35 | "connection": "keep-alive", |
38 | 36 | "content-length": "0", |
39 | 37 | "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", |
41 | 38 | } |
42 | 39 |
|
43 | 40 | # Headers which should be ignored from validation. This should only be used when the value of a header cannot be accurately be predicted. |
44 | 41 | # Note however the existance of these headers is still validated. |
45 | 42 | _ignored_headers = ["Date", "last-modified"] |
46 | 43 |
|
47 | 44 | # Headers which should be excluded from validation entirely. |
48 | | -_excluded_headers = ["Keep-Alive"] |
| 45 | +_excluded_headers = ["Keep-Alive", "Strict-Transport-Security"] |
49 | 46 |
|
50 | 47 | _HEADER_REQUEST_ID = "x-request-id" |
51 | 48 | _HEADER_ERS_TRANSACTION_ID = "X_ERS_TRANSACTION_ID" |
@@ -100,7 +97,12 @@ def assert_headers( |
100 | 97 | """ |
101 | 98 |
|
102 | 99 | 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 | + ) |
104 | 106 | ) |
105 | 107 |
|
106 | 108 | expected_headers = dict(generic_headers) |
@@ -151,7 +153,12 @@ def assert_upload_response_headers( |
151 | 153 | """ |
152 | 154 |
|
153 | 155 | 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 | + ) |
155 | 162 | ) |
156 | 163 |
|
157 | 164 | expected_headers = dict(_generic_upload_headers) |
|
0 commit comments