Skip to content

Commit f85e9d3

Browse files
committed
v0.0.11
1 parent 6e08f42 commit f85e9d3

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
## [0.0.10] - 2020-05-31
4+
## [0.0.11] - 2022-03-18
5+
#### Fixed
6+
* Sending HSTS header no longer requires building with OpenSSL #12
7+
* Fixes HSTS preload was not added by default #15
8+
9+
## [0.0.10] - 2022-03-13
10+
#### Added
11+
* Ability to opt-out of added `preload` addition for HSTS, using `security_headers_hsts_preload off;`.
12+
* Remove X-Application-Version header
13+
* For adding HSTS, check URL protocol instead of connection protocol to be 'https://' #12
14+
15+
## [0.0.9] - 2020-05-31
516
### Changed
617
* `X-Content-Type-Options` is now sent for all resources to accomodate Chromium's CORB
718
(see [webhint.io #1221](https://github.com/webhintio/hint/issues/1221))

src/ngx_http_security_headers_module.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,16 @@ ngx_http_security_headers_filter(ngx_http_request_t *r)
268268
ngx_set_headers_out_by_search(r, &key, &val);
269269
}
270270

271-
#if (NGX_HTTP_SSL)
272271
if (r->schema.len == 5 && ngx_strncmp(r->schema.data, "https", 5) == 0)
273272
{
274273
ngx_str_set(&key, "Strict-Transport-Security");
275274
if (1 == slcf->hsts_preload) {
276-
ngx_str_set(&val, "max-age=63072000; includeSubDomains");
277-
} else {
278275
ngx_str_set(&val, "max-age=63072000; includeSubDomains; preload");
276+
} else {
277+
ngx_str_set(&val, "max-age=63072000; includeSubDomains");
279278
}
280279
ngx_set_headers_out_by_search(r, &key, &val);
281280
}
282-
#endif
283281

284282
/* Add X-Frame-Options */
285283
if (r->headers_out.status != NGX_HTTP_NOT_MODIFIED

0 commit comments

Comments
 (0)