Update whapi.js

More concise and reasonable regular expression fix
This commit is contained in:
DayShift 2025-01-26 01:28:58 +08:00 committed by GitHub
parent 84d67a239b
commit 16ab2425e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,7 @@ class Whapi extends NotificationProvider {
"body": msg,
};
let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/(?<!\/)\/*$/, "") + "/messages/text";
let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/([^\/])\/+$/, "$1") + "/messages/text";
await axios.post(url, data, config);