Add search param passthru

This commit is contained in:
aura 2023-01-26 06:36:34 +00:00
parent cf1c7edc9c
commit 657fb45864
No known key found for this signature in database

View file

@ -84,6 +84,13 @@ async function handleRequest(event) {
fetch(url, { method: 'POST', headers, body: JSON.stringify(data) }), 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 } }) return new Response(null, { status: 302, headers: { Location: url } })
} }
} else if (request.method == 'DELETE') { } else if (request.method == 'DELETE') {