fix: check aliyun fc with official env var

Check aliyun fc with official env var.
    see example code in: https://help.aliyun.com/document_detail/89032.html
    use of FC_SERVER_PATH with fixed path php7.2 may not compatible with higher php version
This commit is contained in:
Menu Yang
2022-01-27 15:00:30 +08:00
parent 95c6657dc1
commit 79c35daca0
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -67,8 +67,8 @@ function GetPathSetting($event, $context)
$_SERVER['host'] = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
$_SERVER['referhost'] = explode('/', $event['headers']['Referer'][0])[2];
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = $event['headers']['If-Modified-Since'][0];
$_SERVER['FC_FUNC_CODE_PATH'] = getenv('FC_FUNC_CODE_PATH');
$_SERVER['REQUEST_METHOD'] = $event['method'];
$_SERVER['FC_SERVER_PATH'] = '/var/fc/runtime/php7.2';
return $path;
//return spurlencode($path, '/');
}