Fix path processing in index.php
This commit is contained in:
@@ -26,10 +26,10 @@ if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
|||||||
$code = 500;
|
$code = 500;
|
||||||
} else if(isset($_GET['path'])) {
|
} else if(isset($_GET['path'])) {
|
||||||
$path = trim($_GET['path'], ' /');
|
$path = trim($_GET['path'], ' /');
|
||||||
$pathParts = explode('/', $_GET['path']);
|
$pathParts = explode('/', $path);
|
||||||
if(count($pathParts) > 0 && $pathParts[0] == 'healthz') {
|
if(count($pathParts) > 0 && $pathParts[0] == 'healthz') {
|
||||||
$result = 'OK';
|
$result = 'OK';
|
||||||
} else if(count($pathParts) > 1 && $pathParts[0] == 'notification') {
|
} else if(count($pathParts) > 0 && $pathParts[0] == 'notification') {
|
||||||
// Any notification/[version] will be answered here
|
// Any notification/[version] will be answered here
|
||||||
$msg = 'Fake API endpoint for v' . $minVersionName . ' active and reachable (contacted at ' . date('r') . ').';
|
$msg = 'Fake API endpoint for v' . $minVersionName . ' active and reachable (contacted at ' . date('r') . ').';
|
||||||
if(intval($pathParts[1]) < $minVersionNumber) {
|
if(intval($pathParts[1]) < $minVersionNumber) {
|
||||||
|
|||||||
Reference in New Issue
Block a user