Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where nextP is not replaced in searchParams #49315

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/next/src/server/web/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export async function adapter(
nextConfig: params.request.nextConfig,
})

for (const key of requestUrl.searchParams.keys()) {
// Iterator uses an index to keep track of the current iteration. Because of deleting and appending below we can't just use the iterator.
// Instead we use the keys before iteration.
const keys = [...requestUrl.searchParams.keys()]
for (const key of keys) {
const value = requestUrl.searchParams.getAll(key)

if (
Expand Down