This commit is contained in:
gaofeng
2026-08-11 10:32:21 +08:00
parent 8a9c05641b
commit 202ad2cac5
2 changed files with 8 additions and 1 deletions

View File

@@ -32,10 +32,12 @@ final class CustomerCenterService
return '';
}
$userUrl = rtrim(trim($userUrl), '/');
$endpoint = preg_replace(
'#/users/[^/?]+(?:\?.*)?$#i',
'/customer_center/' . $action,
trim($userUrl)
$userUrl
);
return is_string($endpoint) && $endpoint !== $userUrl ? $endpoint : '';

View File

@@ -24,6 +24,11 @@ customerCenterProxyAssertSame(
$service->endpoint('https://uniuser.jzvisa.com/home/users/userLogin', 'applications'),
'The proxy endpoint must stay on the configured unified API host'
);
customerCenterProxyAssertSame(
'https://uniuser.jzvisa.com/home/customer_center/applicants',
$service->endpoint('https://uniuser.jzvisa.com/home/users/userLogin/', 'applicants'),
'The proxy endpoint must accept the trailing slash used by the site configuration'
);
customerCenterProxyAssertSame(
'',
$service->endpoint('https://example.com/unexpected', 'applications'),