Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Modify detection of HTTPS
Browse files Browse the repository at this point in the history
This modifies the detection of HTTPS by checking whether the lower-case value of the HTTPS-key of the server variable equals 'on'. Before that checked whether the value did *not* match 'off' which meant that the nginx-default for non-HTTPS connections (which, according to the [documentation](http://nginx.org/en/docs/http/ngx_http_core_module.html#var_https) is an empty string) did in fact match and returned that the connection *is* encrypted.

This fixes #362
# Conflicts:
#	src/functions/marshal_uri_from_sapi.php
  • Loading branch information
michalbundyra committed Jul 11, 2019
1 parent 1dc4959 commit ae3aec8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions/marshal_uri_from_sapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function marshalUriFromSapi(array $server, array $headers)
} else {
$https = false;
}
if (($https && 'off' !== strtolower($https))
if (($https && 'on' === strtolower($https))
|| strtolower($getHeaderFromArray('x-forwarded-proto', $headers, false)) === 'https'
) {
$scheme = 'https';
Expand Down

0 comments on commit ae3aec8

Please sign in to comment.