From 9d677c8aeec5be8569e2be229fc97a5c5f0d90b4 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 Nov 2021 11:42:19 +0000 Subject: [PATCH] fix: too many redirect in SCF/FC/FG/CFC --- platform/AliyunFC.php | 3 --- platform/BaiduCFC.php | 2 -- platform/HuaweiFG_env.php | 2 -- platform/HuaweiFG_file.php | 2 -- platform/TencentSCF_env.php | 2 -- platform/TencentSCF_file.php | 2 -- 6 files changed, 13 deletions(-) diff --git a/platform/AliyunFC.php b/platform/AliyunFC.php index 09c5f49..2618d89 100644 --- a/platform/AliyunFC.php +++ b/platform/AliyunFC.php @@ -54,9 +54,6 @@ function GetPathSetting($event, $context) //$_SERVER['base_path'] = substr($tmp, 0, strlen(urldecode($event['path']))); } $_SERVER['base_path'] = spurlencode($_SERVER['base_path'], '/'); - - if (substr($path,-1)=='/') $path=substr($path,0,-1); - $_SERVER['is_guestup_path'] = is_guestup_path($path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['clientIP']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['X-Requested-With'][0]; diff --git a/platform/BaiduCFC.php b/platform/BaiduCFC.php index c8ba09e..f2b21e6 100644 --- a/platform/BaiduCFC.php +++ b/platform/BaiduCFC.php @@ -34,8 +34,6 @@ function GetPathSetting($event, $context) $_SERVER['functionBrn'] = $context['functionBrn']; $_SERVER['base_path'] = '/'; $path = $event['path']; - if (substr($path,-1)=='/') $path=substr($path,0,-1); - $_SERVER['is_guestup_path'] = is_guestup_path($path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['X-Requested-With']; diff --git a/platform/HuaweiFG_env.php b/platform/HuaweiFG_env.php index d65ae59..d3cebd9 100644 --- a/platform/HuaweiFG_env.php +++ b/platform/HuaweiFG_env.php @@ -57,8 +57,6 @@ function GetPathSetting($event, $context) $_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path)); if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/'; } - if (substr($path,-1)=='/') $path=substr($path,0,-1); - $_SERVER['is_guestup_path'] = is_guestup_path($path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['headers']['x-real-ip']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; diff --git a/platform/HuaweiFG_file.php b/platform/HuaweiFG_file.php index 38422fa..64e6199 100644 --- a/platform/HuaweiFG_file.php +++ b/platform/HuaweiFG_file.php @@ -57,8 +57,6 @@ function GetPathSetting($event, $context) $_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path)); if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/'; } - if (substr($path,-1)=='/') $path=substr($path,0,-1); - $_SERVER['is_guestup_path'] = is_guestup_path($path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['headers']['x-real-ip']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; diff --git a/platform/TencentSCF_env.php b/platform/TencentSCF_env.php index 6210d6b..c8084ae 100644 --- a/platform/TencentSCF_env.php +++ b/platform/TencentSCF_env.php @@ -41,8 +41,6 @@ function GetPathSetting($event, $context) $_SERVER['base_path'] = $event['requestContext']['path']; $path = substr($event['path'], strlen($event['requestContext']['path'])); } - if (substr($path,-1)=='/') $path=substr($path,0,-1); - $_SERVER['is_guestup_path'] = is_guestup_path($path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; diff --git a/platform/TencentSCF_file.php b/platform/TencentSCF_file.php index 27acaa1..78e8600 100644 --- a/platform/TencentSCF_file.php +++ b/platform/TencentSCF_file.php @@ -41,8 +41,6 @@ function GetPathSetting($event, $context) $_SERVER['base_path'] = $event['requestContext']['path']; $path = substr($event['path'], strlen($event['requestContext']['path'])); } - if (substr($path,-1)=='/') $path=substr($path,0,-1); - $_SERVER['is_guestup_path'] = is_guestup_path($path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with'];