Skip to content

Commit

Permalink
Merge pull request #3389 from opral/parjs-370-paraglide-next-middlewa…
Browse files Browse the repository at this point in the history
…re-removes-search-params

Parjs-370-paraglide-next-middleware-removes-search-params
  • Loading branch information
samuelstroschein authored Feb 10, 2025
2 parents f02e508 + b9d0849 commit b23b617
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 b23b617

Please sign in to comment.