1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-08-04 21:58:18 +02:00

Fix of X-Forwarded-Proto server variable (issue #92)

This commit is contained in:
Dalibor Janák
2016-12-06 18:10:06 +01:00
parent d7a4ad03c1
commit 758b6a1e4d

View File

@@ -1228,7 +1228,7 @@ class Router {
$request_method = strtolower($_SERVER['REQUEST_METHOD']); $request_method = strtolower($_SERVER['REQUEST_METHOD']);
$path_info = '/'; $path_info = '/';
global $config; global $config;
$config['protocol'] = ((isset($_SERVER['HTTPS']) or $_SERVER['SERVER_PORT'] == '443') or $_SERVER['X-Forwarded-Proto']) == 'https' ? 'https' : 'http'; $config['protocol'] = ((isset($_SERVER['HTTPS']) or $_SERVER['SERVER_PORT'] == '443') or $_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https' ? 'https' : 'http';
if (!empty($_SERVER['PATH_INFO'])) { if (!empty($_SERVER['PATH_INFO'])) {
$path_info = $_SERVER['PATH_INFO']; $path_info = $_SERVER['PATH_INFO'];
} else if (!empty($_SERVER['ORIG_PATH_INFO']) && strpos($_SERVER['ORIG_PATH_INFO'], 'tileserver.php') === false) { } else if (!empty($_SERVER['ORIG_PATH_INFO']) && strpos($_SERVER['ORIG_PATH_INFO'], 'tileserver.php') === false) {