Fix isURL function to by pass url with localhost, when webhook is enable

This commit is contained in:
Helio Elias 2023-08-08 21:06:58 -03:00
parent 83ed0e6454
commit f32e259d2f
3 changed files with 1 additions and 32 deletions

View File

@ -1,15 +0,0 @@
import nodeWindows from 'node-windows';
import path from 'path';
const svc = new nodeWindows.Service({
name: 'EvolutionAPIServer',
description:
'WhatsApp-Api-NodeJs - This project is based on the CodeChat. The original project is an implementation of Baileys',
script: path.join(__dirname, 'main.js'),
});
svc.on('install', () => {
svc.start();
});
svc.install();

View File

@ -1,16 +0,0 @@
import nodeWindows from 'node-windows';
import path from 'path';
const svc = new nodeWindows.Service({
name: 'EvolutionAPIServer',
description:
'WhatsApp-Api-NodeJs - This project is based on the CodeChat. The original project is an implementation of Baileys',
script: path.join(__dirname, 'main.js'),
});
svc.on('uninstall', () => {
console.log('Uninstall complete.');
console.log('The service exists: ', svc.exists);
});
svc.uninstall();

View File

@ -453,7 +453,7 @@ export class WAStartupService {
}
try {
if (this.localWebhook.enabled && isURL(this.localWebhook.url)) {
if (this.localWebhook.enabled && isURL(this.localWebhook.url, { require_tld: false })) {
const httpService = axios.create({ baseURL });
const postData = {
event,