We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 622e745 commit 2c7c124Copy full SHA for 2c7c124
src/api/services/ntfy.ts
@@ -1,6 +1,12 @@
1
import { configPrivate } from '$config/private';
2
import { configPublic } from '$config/public';
3
4
+function encodeRFC2047B(str: string) {
5
+ // Use Buffer in Node; fallback to btoa in browser-like envs
6
+ const base64 = Buffer.from(str, 'utf8').toString('base64');
7
+ return `=?UTF-8?B?${base64}?=`;
8
+}
9
+
10
export async function sendToNtfyTopic({
11
body,
12
topic,
@@ -14,7 +20,7 @@ export async function sendToNtfyTopic({
14
20
method: 'PUT',
15
21
body: JSON.stringify({ message: body, topic }),
16
22
headers: {
17
- Title: encodeURIComponent(title)
23
+ Title: encodeRFC2047B(title)
18
24
// Priority: 'urgent',
19
25
// Tags: 'warning,skull'
26
}
0 commit comments