feat: add backwards compatibility for POST requests
This commit is contained in:
1 parent
c843d8bb45
commit
93e144a837
2 files changed
+74
-30
No files matched your search
+6
-1
@@ -33,8 +33,13 @@ async function customFetch(
|
||||
): Promise<Response> {
|
||||
const f = func ? func : fetch
|
||||
|
||||
const url = toURL(input)
|
||||
if (init?.body && auth) {
|
||||
const json = JSON.parse(init.body.toString())
|
||||
json.auth = auth
|
||||
init.body = JSON.stringify(json)
|
||||
}
|
||||
|
||||
const url = toURL(input)
|
||||
if (auth && url) url.searchParams.set('auth', auth)
|
||||
|
||||
const res = await f(url ?? input, init)
|
||||
|
||||
Reference in new issue
Block a user