Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug image resizing with url containing 127.0.0.1 #2276

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/(global)/~gitbook/image/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -24,7 +26,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.
Expand Down
Loading