mirror of
https://github.com/jambonz/jambonz-node.git
synced 2025-12-19 05:17:49 +00:00
Merge pull request #8 from jambonz/fix/create_call_hook
call_hook can be http or ws
This commit is contained in:
@@ -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');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user