fix: send slack message throw 400 invalid_attachments (#6014)

This commit is contained in:
JianChao Ye
2025-07-28 22:55:46 +08:00
committed by GitHub
parent c1adcfbfc2
commit 771d05363e
3 changed files with 12 additions and 3 deletions

View File

@@ -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",