mirror of
https://github.com/librespeed/speedtest.git
synced 2026-08-03 22:28:24 +00:00
Update docker/ui.php
Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com>
This commit is contained in:
parent
fe85a805ac
commit
0274f6e587
1 changed files with 6 additions and 1 deletions
|
|
@ -14,7 +14,12 @@ $mode=getenv("MODE");
|
|||
if($mode=="standalone" || $mode=="backend"){ ?>
|
||||
var SPEEDTEST_SERVERS=[];
|
||||
<?php } elseif ($mode=="dual") {
|
||||
$servers = json_decode(file_get_contents('/servers.json'), true);
|
||||
$jsonContent = @file_get_contents('/servers.json');
|
||||
if ($jsonContent === false) {
|
||||
$servers = [];
|
||||
} else {
|
||||
$servers = json_decode($jsonContent, true) ?: [];
|
||||
}
|
||||
|
||||
// find out my own URL
|
||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue