From dde6e588e9632a398a46a9cfda0a5ded86b0084a Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 26 Nov 2023 18:28:25 -0500 Subject: [PATCH] fix end point --- www-api/app/Controllers/Bko.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www-api/app/Controllers/Bko.php b/www-api/app/Controllers/Bko.php index a5d9a180..b6618f52 100644 --- a/www-api/app/Controllers/Bko.php +++ b/www-api/app/Controllers/Bko.php @@ -40,7 +40,20 @@ class Bko extends BaseController exit(); } - $endpoint = strtolower(str_replace('/svs/bko/', '', strtok($_SERVER['REQUEST_URI'], '?'))); + $uri = urldecode(current_url(true)); + $findme = '?'; + $pos = strpos($uri, $findme); + if ($pos > 5) { + $uri = substr($uri, 0, $pos); + } + log_message('critical', "API-GATE URI -> ".$uri ); + $pieces = explode('/', $uri); + $psc = count($pieces); + + $endpoint = $psc > 0 ? $pieces[$psc - 1] : ''; + log_message('critical', "Enpoint-> ".$endpoint ); + + // $endpoint = strtolower(str_replace('/svs/bko/', '', strtok($_SERVER['REQUEST_URI'], '?'))); log_message('critical', "BkoApi Path GATE 001 endpoint = $endpoint");