This commit is contained in:
./raj authored and GitHub committed 2025-03-19 20:30:11 +00:00
1 parent 348df2329a
commit 0b4005743e
1 file changed
+6 -1
+6 -1
View File
@@ -36,12 +36,17 @@ async function customFetch(
): Promise<Response> { ): Promise<Response> {
const f = func ? func : fetch const f = func ? func : fetch
if (init) if (init) {
init.headers = { init.headers = {
...init.headers, ...init.headers,
...(auth ? { authorization: `Bearer ${auth}` } : {}), ...(auth ? { authorization: `Bearer ${auth}` } : {}),
} }
if (auth) {
init.cache = 'no-store'
}
}
if (init?.body && auth) { if (init?.body && auth) {
try { try {
const json = JSON.parse(init.body.toString()) const json = JSON.parse(init.body.toString())