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)