further fix for #192, also bug fix for starting with a ws connection and switching to webhooks later in the same call

This commit is contained in:
Dave Horton
2022-12-05 10:53:41 -05:00
parent c728417581
commit 46302703da
3 changed files with 4 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ 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);
return requestor.request(type, hook, params, httpHeaders);
}