mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-11 15:37:57 +00:00
fix host validation, impove debug message
This commit is contained in:
parent
d1428b6a16
commit
8b09dbd1bd
@ -35,12 +35,12 @@ foreach (json_decode(file_get_contents(__DIR__ . '/../../config/nodes.json')) as
|
|||||||
|
|
||||||
if (empty($thisUrl->host->name) ||
|
if (empty($thisUrl->host->name) ||
|
||||||
empty($manifestUrl->host->name) ||
|
empty($manifestUrl->host->name) ||
|
||||||
$manifestUrl->host->name == $thisUrl->host->name) // @TODO some mirrors could be available, improve condition
|
$manifestUrl->host->name == $thisUrl->host->name) // @TODO some mirrors could be available on same host sub-folders, improve condition
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$connectionWhiteList[] = $manifestUrl->host->name;
|
$connectionWhiteList[] = str_replace(['[',']'], false, $manifestUrl->host->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// API import enabled
|
// API import enabled
|
||||||
@ -79,7 +79,10 @@ else if (!in_array($_SERVER['REMOTE_ADDR'], $connectionWhiteList))
|
|||||||
$response =
|
$response =
|
||||||
[
|
[
|
||||||
'status' => false,
|
'status' => false,
|
||||||
'message' => _('Access denied for this host')
|
'message' => sprintf(
|
||||||
|
_('Access denied for host "%s"'),
|
||||||
|
$_SERVER['REMOTE_ADDR']
|
||||||
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user