Rewritten querystring not visible in getServerSideProps req
object
#40528
Labels
bug
Issue was opened via the bug report template.
req
object
#40528
Verify canary release
Provide environment information
npx --no-install next info
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next dev
Describe the Bug
When a query string is added in middleware.js, it is not reflected in
context.req.url
ofgetServerSideProps
.Interestingly, the updated query string is reflected in
context.query
This is similar to #40260 which was fixed in 12.3
Expected Behavior
context.req.url should contain the rewritten URL, not the original URL.
Link to reproduction
https://replit.com/@ColinSidoti/Nextjs
To Reproduce
Visit https://nextjs.colinsidoti.repl.co/
You should see:
req.url should be "/?bar=baz" instead of "/"
The text was updated successfully, but these errors were encountered: