Skip to content

Commit 9be3376

Browse files
committed
fix #2884
1 parent d6b493c commit 9be3376

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/cli/integrations/chatwoot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const setupChatwootOutgoingMessageHandler: (cliConfig: cliFlags, client:
9393
const port = _u.port || 80;
9494
const accountNumber = await client.getHostNumber()
9595
const proms = [];
96-
let expectedSelfWebhookUrl = cliConfig.apiHost ? `${cliConfig.apiHost}/chatwoot ` : `${(cliConfig.host as string).includes('http') ? '' : 'http://'}${cliConfig.host}:${cliConfig.port}/chatwoot `;
96+
let expectedSelfWebhookUrl = cliConfig.apiHost ? `${cliConfig.apiHost}/chatwoot ` : `${(cliConfig.host as string).includes('http') ? '' : `http${cliConfig.https || (cliConfig.cert && cliConfig.privkey) ? 's' : ''}://`}${cliConfig.host}:${cliConfig.port}/chatwoot `;
9797
expectedSelfWebhookUrl = expectedSelfWebhookUrl.trim()
9898
if(cliConfig.key) expectedSelfWebhookUrl = `${expectedSelfWebhookUrl}?api_key=${cliConfig.key}`
9999
let [accountId, inboxId] = (u.match(/\/(app|(api\/v1))\/accounts\/\d*\/(inbox|inboxes)\/\d*/g) || [''])[0].split('/').filter(Number)

src/cli/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export const setupHttpServer = (cliConfig: cliFlags) => {
8282
if(privContents && certContents) {
8383
const options = {key: privContents,cert: certContents}
8484
server = https.createServer(options as ServerOptions, app);
85+
cliConfig.https = true;
8586
return;
8687
}
8788
}

0 commit comments

Comments
 (0)