Skip to content

Commit 3987213

Browse files
committed
Detecting HTTPS.
1 parent 3efdd33 commit 3987213

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/PhpCgiBase.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ export class PhpCgiBase
423423
putEnv(php, 'REQUEST_METHOD', method);
424424
putEnv(php, 'REMOTE_ADDR', '127.0.0.1');
425425
putEnv(php, 'HTTP_HOST', selfUrl.host);
426-
putEnv(php, 'REQUEST_SCHEME', selfUrl.protocol.substr(0, selfUrl.protocol.length - 0));
426+
putEnv(php, 'REQUEST_SCHEME', selfUrl.protocol);
427+
putEnv(php, 'HTTPS', selfUrl.protocol === 'https' ? 'on' : 'off');
427428

428429
putEnv(php, 'DOCUMENT_ROOT', docroot);
429430
putEnv(php, 'REQUEST_URI', originalPath);

0 commit comments

Comments
 (0)