MAPG-99 use HTTP_HOST instead of SERVER_NAME to prevent wrong redirection

This commit is contained in:
Bence Pőcze 2020-06-01 22:44:44 +02:00
parent b4de510a65
commit 637ed5d0ac

View File

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