diff --git a/lib/utils/ws-requestor.js b/lib/utils/ws-requestor.js index fba4761d..8e707da1 100644 --- a/lib/utils/ws-requestor.js +++ b/lib/utils/ws-requestor.js @@ -54,8 +54,8 @@ class WsRequestor extends BaseRequestor { /* if we have an absolute url, and it is http then do a standard webhook */ if (this._isAbsoluteUrl(url) && url.startsWith('http')) { this.logger.debug({hook}, 'WsRequestor: sending a webhook (HTTP)'); - const requestor = new HttpRequestor(this.logger, this.account_sid, hook, this.secret); - //const requestor = new HttpRequestor(this.logger, this.account_sid, {url: hook}, this.secret); + const h = typeof hook === 'object' ? hook : {url: hook}; + const requestor = new HttpRequestor(this.logger, this.account_sid, h, this.secret); if (type === 'session:redirect') { this.close(); this.emit('handover', requestor);