Proxy forwards Query parameters too

This commit is contained in:
June 2025-08-16 11:01:56 +12:00
parent 2e54690ee4
commit b3f92210fa
Signed by: breadone
GPG Key ID: FDC19FE143200483

View File

@ -5,8 +5,7 @@ import type { APIRoute } from "astro";
const getProxyUrl = (request: Request) => {
const proxyUrl = new URL(import.meta.env.PUBLIC_PB_URL);
const requestUrl = new URL(request.url);
return new URL(requestUrl.pathname, proxyUrl);
return new URL(requestUrl.pathname + requestUrl.search, proxyUrl);
};
export const ALL: APIRoute = async ({ request }) => {