Skip to content

Commit fd0e733

Browse files
committed
Check request protocol instead of connection protocol for #12
1 parent ef6d1c7 commit fd0e733

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ngx_http_security_headers_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ ngx_http_security_headers_filter(ngx_http_request_t *r)
225225
ngx_str_set(&key, "x-varnish");
226226
ngx_str_set(&val, "");
227227
ngx_set_headers_out_by_search(r, &key, &val);
228-
228+
229229
/* Hide X-Application-Version */
230230
ngx_str_set(&key, "x-application-version");
231231
ngx_str_set(&val, "");
@@ -261,7 +261,7 @@ ngx_http_security_headers_filter(ngx_http_request_t *r)
261261
}
262262

263263
#if (NGX_HTTP_SSL)
264-
if (r->connection->ssl)
264+
if (r->schema.len == 5 && ngx_strncmp(r->schema.data, "https", 5) == 0)
265265
{
266266
ngx_str_set(&key, "Strict-Transport-Security");
267267
ngx_str_set(&val, "max-age=63072000; includeSubDomains; preload");

0 commit comments

Comments
 (0)