From a6a1741562071bb19b0c0489d864aeb260adf86b Mon Sep 17 00:00:00 2001 From: yilee <930617673@qq.com> Date: Mon, 2 Jun 2025 16:38:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:ntfy=E5=8A=A8=E4=BD=9C=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/notify.ts | 2 +- sample/notify.js | 2 +- sample/notify.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/back/services/notify.ts b/back/services/notify.ts index 25f62fe2..9bb11a50 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -641,7 +641,7 @@ export default class NotificationService { headers['Authorization'] = `Basic ${Buffer.from(`${ntfyUsername}:${ntfyPassword}`).toString('base64')}`; } if (ntfyActions) { - headers['Actions'] = ntfyActions; + headers['Actions'] = encodeRfc2047(ntfyActions); } const res = await httpClient.request( `${ntfyUrl || 'https://ntfy.sh'}/${ntfyTopic}`, diff --git a/sample/notify.js b/sample/notify.js index dd5d15fd..8dfe8851 100644 --- a/sample/notify.js +++ b/sample/notify.js @@ -1280,7 +1280,7 @@ function ntfyNotify(text, desp) { options.headers['Authorization'] = `Basic ${Buffer.from(`${NTFY_USERNAME}:${NTFY_PASSWORD}`).toString('base64')}`; } if (NTFY_ACTIONS) { - options.headers['Actions'] = NTFY_ACTIONS; + options.headers['Actions'] = encodeRFC2047(NTFY_ACTIONS); } $.post(options, (err, resp, data) => { diff --git a/sample/notify.py b/sample/notify.py index 8297ecce..032bb97e 100644 --- a/sample/notify.py +++ b/sample/notify.py @@ -817,7 +817,7 @@ def ntfy(title: str, content: str) -> None: authStr = push_config.get("NTFY_USERNAME") + ":" + push_config.get("NTFY_PASSWORD") headers['Authorization'] = "Basic " + base64.b64encode(authStr.encode('utf-8')).decode('utf-8') if push_config.get("NTFY_ACTIONS"): - headers['Actions'] = push_config.get("NTFY_ACTIONS") + headers['Actions'] = encode_rfc2047(push_config.get("NTFY_ACTIONS")) url = push_config.get("NTFY_URL") + "/" + push_config.get("NTFY_TOPIC") response = requests.post(url, data=data, headers=headers)