You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
vercel
locked as resolved and limited conversation to collaborators
Jan 30, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
kind: bugConfirmed bug that is on the backlogUpstreamRelated to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Bug report
Describe the bug
Router.push/replace ignores trailing spaces on the last query parameter, even if already encoded (%20). Examples:
Router.push("/?q=unencoded trailing ")
results in query ={ "q": "unencoded trailing" }
Router.push(encodeURI("/?q=encoded trailing "))
results in query ={ "q": "encoded trailing" }
Router.push({ pathname: "/", query: { q: "unencoded trailing " } })
results in query ={ "q": "unencoded trailing" }
Router.push("/?q=unencoded trailing &add=trailing ")
results in query ={ "q": "unencoded trailing ", "add": "trailing" }
(only the last param got stripped)To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
git clone https://github.com/renato/nextjs-using-router-trailing-space
npm install
npm run dev
Expected behavior
The query object should consistently have the complete string, with the trailing spaces, even for the last parameter.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
I don't know exactly what version changed the behavior, but this issue didn't happen some months ago.
The text was updated successfully, but these errors were encountered: