matthewmueller / matthewmueller/next-redirect
Query parameters get escaped on client but not server
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 52
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to redirect to a login page with a query parameter:
nextRedirect(context, `/login?from=${context.asPath}`);
This works fine when it's run on the server, but when it gets run on the client, the ? in the path gets encoded as %3F leading to a 404 not found (because the path ends up being /login%3Ffrom= instead of /login?from=.
I'm gonna throw together a PR.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides no file or test names. Start by reproducing the client-side redirect with the shown nextRedirect call and compare it with server-side behavior; done means the query delimiter remains ? and /login?from=... resolves instead of producing a 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, next.js
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100