File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/open-next/src/core/routing Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -451,10 +451,16 @@ export async function invalidateCDNOnRequest(
451451export function normalizeLocationHeader ( location : string , url : string ) : string {
452452 const locationUrl = new URL ( location ) ;
453453 const host = new URL ( url ) . host ;
454-
454+
455455 // Encode the search parameters to ensure they are valid according to RFC
456- const encodedSearch = locationUrl . searchParams . toString ( ) ? `?${ locationUrl . searchParams . toString ( ) } ` : '' ;
457- const href = locationUrl . origin + locationUrl . pathname + encodedSearch + locationUrl . hash ;
456+ const encodedSearch = locationUrl . searchParams . toString ( )
457+ ? `?${ locationUrl . searchParams . toString ( ) } `
458+ : "" ;
459+ const href =
460+ locationUrl . origin +
461+ locationUrl . pathname +
462+ encodedSearch +
463+ locationUrl . hash ;
458464 if ( locationUrl . host === host ) {
459465 // If the location is relative to the host
460466 return href . replace ( locationUrl . origin , "" ) ;
You can’t perform that action at this time.
0 commit comments