File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
packages/gitbook/src/app/(global)/~gitbook/image Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' gitbook ' : minor
3+ ---
4+
5+ Fix an issue where the redirects of potentially malicious images were not going through.
Original file line number Diff line number Diff line change 1- import { NextRequest } from 'next/server' ;
1+ import { NextRequest , NextResponse } from 'next/server' ;
22
33import {
44 CURRENT_SIGNATURE_VERSION ,
@@ -45,7 +45,7 @@ export async function GET(request: NextRequest) {
4545 }
4646
4747 if ( signatureVersion !== CURRENT_SIGNATURE_VERSION ) {
48- return Response . redirect ( url , 302 ) ;
48+ return NextResponse . redirect ( url , 302 ) ;
4949 }
5050
5151 // Cloudflare-specific options are in the cf object.
@@ -92,7 +92,7 @@ export async function GET(request: NextRequest) {
9292 return response ;
9393 } catch ( error ) {
9494 // Redirect to the original image if resizing fails
95- return Response . redirect ( url , 302 ) ;
95+ return NextResponse . redirect ( url , 302 ) ;
9696 }
9797}
9898
You can’t perform that action at this time.
0 commit comments