From 37b4eb56f9c8ea34e61b577f5cd7199d73279db1 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Tue, 19 Dec 2023 14:53:35 +0700 Subject: [PATCH] call_hook can be http or ws --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index d10fc94..38fd0bb 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -51,7 +51,7 @@ const validateCallCreate = (opts) => { assert.ok(call_status_hook || !call_hook, 'calls.create: call_status_hook is required when call_hook is used'); const hookUrl = typeof call_hook === 'object' ? call_hook.url : call_hook; - if (hookUrl) assert.ok(/^https?:/.test(hookUrl), 'call_hook must be an absolute url'); + if (hookUrl) assert.ok(/^(http|ws)s?:/.test(hookUrl), 'call_hook must be an absolute url'); const hookStatusUrl = typeof call_status_hook === 'object' ? call_status_hook.url : call_status_hook; if (hookStatusUrl) assert.ok(/^https?:/.test(hookStatusUrl), 'call_status_hook must be an absolute url'); };