fix prev commit

This commit is contained in:
Dave Horton
2022-12-09 11:07:41 -05:00
parent 78a76bb1f4
commit 37efdc62be

View File

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