Skip to content

Commit

Permalink
fix: keep search params
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelstroschein committed Feb 10, 2025
1 parent f02e508 commit b9d0849
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions inlang/packages/paraglide/paraglide-next/src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ export async function middleware(request) {
return NextResponse.next();
}

return NextResponse.rewrite(new URL(path, request.url), {
headers: {
"x-paraglide-locale": locale,
},
});
return NextResponse.rewrite(
new URL(path, request.url).toString() + request.nextUrl.search,
{
headers: {
"x-paraglide-locale": locale,
},
}
);
}

0 comments on commit b9d0849

Please sign in to comment.