mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-26 05:25:56 +00:00
Update server/notification-providers/pushdeer.js
More concise and reasonable regular expression fix Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
2098d34c5b
commit
84d67a239b
1 changed files with 2 additions and 1 deletions
|
@ -11,7 +11,8 @@ class PushDeer extends NotificationProvider {
|
||||||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
const okMsg = "Sent Successfully.";
|
const okMsg = "Sent Successfully.";
|
||||||
const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com";
|
const serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com";
|
||||||
const url = `${serverUrl.trim().replace(/(?<!\/)\/*$/, "")}/message/push`;
|
// capture group below is nessesary to prevent an ReDOS-attack
|
||||||
|
const url = `${serverUrl.trim().replace(/([^\/])\/+$/, "$1")}/message/push`;
|
||||||
|
|
||||||
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue