未验证 提交 3f541141 编写于 作者: Q qkqpttgf 提交者: GitHub

fix:get domain path

上级 44f14d9a
......@@ -30,8 +30,8 @@ function GetPathSetting($event, $context)
$_SERVER['function_name'] = $context['function_name'];
$_SERVER['namespace'] = $context['namespace'];
$host_name = $event['headers']['host'];
$_SERVER['HTTP_HOST'] = $host_name;
$serviceId = $event['requestContext']['serviceId'];
$_SERVER['list_path'] = getListpath($host_name);
if ( $serviceId === substr($host_name,0,strlen($serviceId)) ) {
$_SERVER['base_path'] = '/'.$event['requestContext']['stage'].'/'.$_SERVER['function_name'].'/';
$_SERVER['Region'] = substr($host_name, strpos($host_name, '.')+1);
......@@ -43,9 +43,6 @@ function GetPathSetting($event, $context)
$path = substr($event['path'], strlen($event['requestContext']['path']));
}
if (substr($path,-1)=='/') $path=substr($path,0,-1);
if (empty($_SERVER['list_path'])) {
$_SERVER['list_path'] = '/';
}
$_SERVER['is_guestup_path'] = is_guestup_path($path);
$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp'];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册