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
While in development I am trying to use rewrites to proxy a local API server. The rewriting works flawlessly until the length of the URL reaches a certain length- in my case, 990 characters.
Expected Behavior
I'd expect the length of the URL to not impact when a rewrite occurs. Or at least, I'd expect the limit to be large enough to not interfere with reasonable URLs. In my case, I have URLs which need to include certain lengthy tokens (which I do not have control over). If this is intentional, it might be nice to print a warning while in development.
To Reproduce
I was able to reproduce in a fresh project (create-next-app) by adding a next.config.js like so:
module.exports={asyncrewrites(){return[{source: "/:foo*",destination: "https://www.google.com/:foo*",// Can be any URL},];},};
Start the dev server and navigate to this URL, which is 256 characters:
You should instead see a Next.js bad page error. So far as I can tell there is no "rewrite" happening (though I found this kind of difficult to debug).
Note - when creating a reproduction, the length of the URL which caused this issue was different (much shorter) than when I originally ran into the issue (using only localhost). Not sure what that's about...
The text was updated successfully, but these errors were encountered:
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 28, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Next.js are you using?
10.2.3
What version of Node.js are you using?
14.16.0
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
next export
Describe the Bug
While in development I am trying to use
rewrites
to proxy a local API server. The rewriting works flawlessly until the length of the URL reaches a certain length- in my case, 990 characters.Expected Behavior
I'd expect the length of the URL to not impact when a rewrite occurs. Or at least, I'd expect the limit to be large enough to not interfere with reasonable URLs. In my case, I have URLs which need to include certain lengthy tokens (which I do not have control over). If this is intentional, it might be nice to print a warning while in development.
To Reproduce
I was able to reproduce in a fresh project (
create-next-app
) by adding anext.config.js
like so:Start the dev server and navigate to this URL, which is 256 characters:
This should correctly direct you to google (albeit they don't have a page at this URL).
Now navigate to this URL, which is 282 characters:
You should instead see a Next.js bad page error. So far as I can tell there is no "rewrite" happening (though I found this kind of difficult to debug).
Note - when creating a reproduction, the length of the URL which caused this issue was different (much shorter) than when I originally ran into the issue (using only localhost). Not sure what that's about...
The text was updated successfully, but these errors were encountered: