Fix a problem with the provision url path which was caused by a pull request in the last 12 hours.

This commit is contained in:
markjcrane
2016-01-16 09:44:15 -07:00
parent 6e2cc41caf
commit eb5842b74a

View File

@@ -553,7 +553,14 @@ require_once "resources/require.php";
else {
$domain_name = $_SESSION['domain_name'];
}
echo " window.location = '".$_SERVER['REQUEST_SCHEME']."://".$domain_name."/app/provision?mac=$device_mac_address&file=' + d + '&content_type=application/octet-stream';\n";
if (!isset($_SERVER['HTTP_PROTOCOL'])) {
$_SERVER['HTTP_PROTOCOL'] = 'http';
if (isset($_SERVER['REQUEST_SCHEME'])) { $_SERVER['HTTP_PROTOCOL'] = $_SERVER['REQUEST_SCHEME']; }
if ($_SERVER['HTTPS'] = 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; }
if ($_SERVER['SERVER_PORT'] = '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; }
}
echo " window.location = '".$_SERVER['HTTP_PROTOCOL']."://".$domain_name."/app/provision?mac=".$device_mac_address."&file=' + d + '&content_type=application/octet-stream';\n";
echo " }\n";
echo "\n";