提交
This commit is contained in:
@@ -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 : '';
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user