mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-26 13:35:56 +00:00
Compare commits
No commits in common. "16ab2425e5a40f1208ee3e29aeba4af8c7cbb9cf" and "2098d34c5be9e6f04d40e7a1e5b6f1d3041df03c" have entirely different histories.
16ab2425e5
...
2098d34c5b
2 changed files with 2 additions and 3 deletions
|
@ -11,8 +11,7 @@ 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";
|
||||||
// capture group below is nessesary to prevent an ReDOS-attack
|
const url = `${serverUrl.trim().replace(/(?<!\/)\/*$/, "")}/message/push`;
|
||||||
const url = `${serverUrl.trim().replace(/([^\/])\/+$/, "$1")}/message/push`;
|
|
||||||
|
|
||||||
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Whapi extends NotificationProvider {
|
||||||
"body": msg,
|
"body": msg,
|
||||||
};
|
};
|
||||||
|
|
||||||
let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/([^\/])\/+$/, "$1") + "/messages/text";
|
let url = (notification.whapiApiUrl || "https://gate.whapi.cloud/").replace(/(?<!\/)\/*$/, "") + "/messages/text";
|
||||||
|
|
||||||
await axios.post(url, data, config);
|
await axios.post(url, data, config);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue