From ebd55843a741edf318238a0e9f8a94ede222a6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 9 Apr 2024 11:37:41 +0200 Subject: [PATCH 1/2] Log raw url --- src/app/(global)/~gitbook/image/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(global)/~gitbook/image/route.ts b/src/app/(global)/~gitbook/image/route.ts index fcde71b59..7a352788a 100644 --- a/src/app/(global)/~gitbook/image/route.ts +++ b/src/app/(global)/~gitbook/image/route.ts @@ -24,7 +24,7 @@ export async function GET(request: NextRequest) { // Verify the signature const verified = await verifyImageSignature(url, signature); if (!verified) { - return new Response(`Invalid signature "${signature ?? ''}" for "${url}"`, { status: 400 }); + return new Response(`Invalid signature "${signature ?? ''}" for "${url}" (${request.url})`, { status: 400 }); } // Cloudflare-specific options are in the cf object. From 6c78594bce1e5e96a45b2fb2746cf606db70b837 Mon Sep 17 00:00:00 2001 From: Johan Preynat Date: Tue, 9 Apr 2024 18:00:44 +0200 Subject: [PATCH 2/2] Log raw url and searchParams extracted URL --- src/app/(global)/~gitbook/image/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/(global)/~gitbook/image/route.ts b/src/app/(global)/~gitbook/image/route.ts index 7a352788a..6b01e218e 100644 --- a/src/app/(global)/~gitbook/image/route.ts +++ b/src/app/(global)/~gitbook/image/route.ts @@ -11,6 +11,8 @@ export const runtime = 'edge'; */ export async function GET(request: NextRequest) { const url = request.nextUrl.searchParams.get('url'); + console.log(request.url); + console.log(url); const signature = request.nextUrl.searchParams.get('sign'); if (!url || !signature) { return new Response('Missing url/sign parameters', { status: 400 });