misc: force init headers

This commit is contained in:
Xylight committed 2024-07-27 13:28:54 -07:00
1 parent 3803649d93
commit 7c74762c2a
1 file changed
+6
+6
View File
@@ -34,6 +34,12 @@ async function customFetch(
): Promise<Response> {
const f = func ? func : fetch
if (init)
init.headers = {
...init.headers,
...(auth ? { authorization: `Bearer ${auth}` } : {}),
}
if (init?.body && auth) {
try {
const json = JSON.parse(init.body.toString())