mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-25 21:15:55 +00:00
Compare commits
2 commits
35bef6ec2b
...
4f61782e85
Author | SHA1 | Date | |
---|---|---|---|
|
4f61782e85 | ||
|
7a9191761d |
2 changed files with 3 additions and 2 deletions
|
@ -11,7 +11,8 @@ class PushDeer extends NotificationProvider {
|
|||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||
const okMsg = "Sent Successfully.";
|
||||
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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue