Skip to content

Commit a21bc57

Browse files
committed
lint
1 parent 17e0793 commit a21bc57

File tree

1 file changed

+9
-3
lines changed
  • packages/open-next/src/core/routing

1 file changed

+9
-3
lines changed

packages/open-next/src/core/routing/util.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,16 @@ export async function invalidateCDNOnRequest(
451451
export 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, "");

0 commit comments

Comments
 (0)