Skip to content

Commit

Permalink
Merge branch 'master' into pr-nostr-update
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Jan 26, 2025
2 parents a99d25b + 7a91917 commit 0e28f5e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ tsconfig.json
/extra/healthcheck.exe
/extra/healthcheck
/extra/exe-builder
/extra/push-examples
/extra/uptime-kuma-push

# Comment the following line if you want to rebuild the healthcheck binary
Expand Down
2 changes: 1 addition & 1 deletion server/modules/apicache/apicache.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ function ApiCache() {
}

if (typeof duration === "string") {
let split = duration.match(/^([\d\.,]+)\s?(\w+)$/);
let split = duration.match(/^([\d\.,]+)\s?([a-zA-Z]+)$/);

if (split.length === 3) {
let len = parseFloat(split[1]);
Expand Down
1 change: 1 addition & 0 deletions server/notification-providers/google-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class GoogleChat extends NotificationProvider {

// construct json data
let data = {
fallbackText: chatHeader["title"],
cardsV2: [
{
card: {
Expand Down
3 changes: 2 additions & 1 deletion server/notification-providers/pushdeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion server/notification-providers/whapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0e28f5e

Please sign in to comment.