Merged in bugfix/MAPG-99-fix-redirect-bug (pull request #78)

MAPG-99 use HTTP_HOST instead of SERVER_NAME to prevent wrong redirection
This commit is contained in:
Bence Pőcze 2020-06-01 20:45:14 +00:00
commit aa68e748dd

View File

@ -3,7 +3,7 @@
require '../main.php'; require '../main.php';
// very basic routing // very basic routing
$host = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['SERVER_NAME']; $host = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
$method = strtolower($_SERVER['REQUEST_METHOD']); $method = strtolower($_SERVER['REQUEST_METHOD']);
$url = substr($_SERVER['REQUEST_URI'], strlen('/')); $url = substr($_SERVER['REQUEST_URI'], strlen('/'));
if (($pos = strpos($url, '?')) !== false) { if (($pos = strpos($url, '?')) !== false) {