From cc0fd539a12dbc0aa27a95b2b8a70dd17806f300 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 21 Sep 2022 15:31:25 +0800 Subject: [PATCH] fix: get wrong ext --- platform/HuaweiFG_env.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/HuaweiFG_env.php b/platform/HuaweiFG_env.php index f3c76c7..83d6451 100644 --- a/platform/HuaweiFG_env.php +++ b/platform/HuaweiFG_env.php @@ -51,13 +51,13 @@ function GetPathSetting($event, $context) $_SERVER['ProjectID'] = $context->getProjectID(); $host_name = $event['headers']['host']; $_SERVER['HTTP_HOST'] = $host_name; - $path = path_format($event['pathParameters'][''].'/'); + $path = path_format('/' . $event['pathParameters']['']); $path = str_replace('+', '%2B', $path); - $_SERVER['base_path'] = path_format($event['path'].'/'); + $_SERVER['base_path'] = path_format($event['path']); if ( $_SERVER['base_path'] == $path ) { $_SERVER['base_path'] = '/'; } else { - $_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path)); + $_SERVER['base_path'] = substr($_SERVER['base_path'], 0, strlen($_SERVER['base_path'])-strlen($path)); if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/'; } //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);