From 2cc3a490fd848eb58b0a840b343ad8b1c4d83e26 Mon Sep 17 00:00:00 2001 From: DayShift <2922897389@qq.com> Date: Sun, 26 Jan 2025 09:06:18 +0800 Subject: [PATCH] Fix unnecessary escape character in regular expression --- server/notification-providers/pushdeer.js | 2 +- server/notification-providers/whapi.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/notification-providers/pushdeer.js b/server/notification-providers/pushdeer.js index e39d61d61..b1f675957 100644 --- a/server/notification-providers/pushdeer.js +++ b/server/notification-providers/pushdeer.js @@ -12,7 +12,7 @@ class PushDeer extends NotificationProvider { const okMsg = "Sent Successfully."; const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com"; // capture group below is nessesary to prevent an ReDOS-attack - const url = `${serverUrl.trim().replace(/([^\/])\/+$/, "$1")}/message/push`; + const url = `${serverUrl.trim().replace(/([^/])\/+$/, "$1")}/message/push`; let valid = msg != null && monitorJSON != null && heartbeatJSON != null; diff --git a/server/notification-providers/whapi.js b/server/notification-providers/whapi.js index 956c265e4..d83dc470f 100644 --- a/server/notification-providers/whapi.js +++ b/server/notification-providers/whapi.js @@ -24,7 +24,7 @@ class Whapi extends NotificationProvider { "body": msg, }; - let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/([^\/])\/+$/, "$1") + "/messages/text"; + let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/([^/])\/+$/, "$1") + "/messages/text"; await axios.post(url, data, config);