Merge pull request #9 from auravoid/main

Add search param pass-through
This commit is contained in:
Erisa A 2023-01-26 13:49:20 +00:00 committed by GitHub
commit 7545f4f0f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,6 +84,13 @@ async function handleRequest(event) {
fetch(url, { method: 'POST', headers, body: JSON.stringify(data) }),
)
}
const searchParams = new URL(request.url).searchParams
url = new URL(url)
searchParams.forEach((value, key) => {
url.searchParams.append(key, value)
})
return new Response(null, { status: 302, headers: { Location: url } })
}
} else if (request.method == 'DELETE') {