mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-11-09 04:49:01 +00:00
bugfix: createCall accepts call_hook that is a ws(s) url
This commit is contained in:
1 parent
9a126f396e
commit
4097ca2125
1 file changed
+2
-2
@@ -240,10 +240,10 @@ async function validateCreateCall(logger, sid, req) {
|
|||||||
if (typeof obj.call_status_hook === 'object' && typeof obj.call_status_hook.url != 'string') {
|
if (typeof obj.call_status_hook === 'object' && typeof obj.call_status_hook.url != 'string') {
|
||||||
throw new DbErrorBadRequest('call_status_hook must be string or an object containing a url property');
|
throw new DbErrorBadRequest('call_status_hook must be string or an object containing a url property');
|
||||||
}
|
}
|
||||||
if (obj.call_hook && !/^https?:/.test(obj.call_hook.url)) {
|
if (obj.call_hook && !/^https?:/.test(obj.call_hook.url) && !/^wss?:/.test(obj.call_hook.url)) {
|
||||||
throw new DbErrorBadRequest('call_hook url be an absolute url');
|
throw new DbErrorBadRequest('call_hook url be an absolute url');
|
||||||
}
|
}
|
||||||
if (obj.call_status_hook && !/^https?:/.test(obj.call_status_hook.url)) {
|
if (obj.call_status_hook && !/^https?:/.test(obj.call_status_hook.url) && !/^wss?:/.test(obj.call_status_hook.url)) {
|
||||||
throw new DbErrorBadRequest('call_status_hook url be an absolute url');
|
throw new DbErrorBadRequest('call_status_hook url be an absolute url');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user