Fix handling of trailing '/' in captcha urls
This commit is contained in:
parent
e41973c238
commit
f152dcccc3
2 changed files with 12 additions and 1 deletions
|
@ -119,6 +119,17 @@ describe('signalRoutes', () => {
|
|||
check(`signalcaptcha://${captchaId}`, result);
|
||||
});
|
||||
|
||||
it('captcha with a trailing slash', () => {
|
||||
const captchaId =
|
||||
'signal-hcaptcha.Foo-bAr_baz.challenge.fOo-bAR_baZ.fOO-BaR_baz';
|
||||
const result: ParsedSignalRoute = {
|
||||
key: 'captcha',
|
||||
args: { captchaId },
|
||||
};
|
||||
const check = createCheck({ hasWebUrl: false });
|
||||
check(`signalcaptcha://${captchaId}/`, result);
|
||||
});
|
||||
|
||||
it('linkCall', () => {
|
||||
const result: ParsedSignalRoute = {
|
||||
key: 'linkCall',
|
||||
|
|
|
@ -347,7 +347,7 @@ export const linkDeviceRoute = _route('linkDevice', {
|
|||
*/
|
||||
export const captchaRoute = _route('captcha', {
|
||||
// needs `(.+)` to capture `.` in hostname
|
||||
patterns: [_pattern('signalcaptcha:', ':captchaId(.+)', '', {})],
|
||||
patterns: [_pattern('signalcaptcha:', ':captchaId(.+)', '{/}?', {})],
|
||||
schema: z.object({
|
||||
captchaId: paramSchema, // opaque
|
||||
}),
|
||||
|
|
Loading…
Add table
Reference in a new issue