diff --git a/package-lock.json b/package-lock.json index ccb72dee3..0ac6f4732 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "uptime-kuma", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "uptime-kuma", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "license": "MIT", "dependencies": { "@grpc/grpc-js": "~1.8.22", @@ -41,6 +41,7 @@ "http-proxy-agent": "~7.0.2", "https-proxy-agent": "~7.0.6", "iconv-lite": "~0.6.3", + "is-url": "^1.2.4", "isomorphic-ws": "^5.0.0", "jsesc": "~3.0.2", "jsonata": "^2.0.3", @@ -11059,6 +11060,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "license": "MIT" + }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", diff --git a/package.json b/package.json index 97b7bc339..5dae1cd77 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "http-proxy-agent": "~7.0.2", "https-proxy-agent": "~7.0.6", "iconv-lite": "~0.6.3", + "is-url": "^1.2.4", "isomorphic-ws": "^5.0.0", "jsesc": "~3.0.2", "jsonata": "^2.0.3", diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js index 455d787c7..33bd4fa81 100644 --- a/server/notification-providers/slack.js +++ b/server/notification-providers/slack.js @@ -2,6 +2,7 @@ const NotificationProvider = require("./notification-provider"); const axios = require("axios"); const { setSettings, setting } = require("../util-server"); const { getMonitorRelativeURL, UP, log } = require("../../src/util"); +const isUrl = require("is-url"); class Slack extends NotificationProvider { name = "slack"; @@ -49,7 +50,7 @@ class Slack extends NotificationProvider { } const address = this.extractAddress(monitorJSON); - if (address) { + if (isUrl(address)) { try { actions.push({ "type": "button",