-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Chose a file separator to replace square brackets [] #8013
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 c 8000 ommunity.
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
Comments
Related to a similar issue with a next+aws plugin serverless-nextjs/serverless-next.js#99 |
That convention is not only causing trouble with AWS but also when serving from Spring Boot using Tomcat as application server. Also it seems that square brackets are not valid in URIs according to RFC3986: https://tools.ietf.org/html/rfc3986?#section-3.2.2
For a workaround: it could help to have a proxy (or middleware) rewrite URLs from |
Can you try |
Looks like encoded urls are now part of the non canary build as of 9.1.2 |
Closing as the |
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. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I just encounter an issue after migrated to the new dynamic routing feature and just found the bad news that AWS API gateway doesn't support square brackets in their path.
Feature request
Add a way to choose a query param separator to replace square brackets
Is your feature request related to a problem? Please describe.
AWS API gateway doesn't support square brackets in the filename so the dynamic routing is not usable on AWS
Describe the solution you'd like
Allowing us to chose what separator we would like could fit in the Nextjs config
dynamic_separator: '___$QUERY___'
Describe alternatives you've considered
I'd love to go on now but unfortunately, this is not an option for this project :/
If anyone has a solution to work around this issue, that would be great.
I've found a little ugly work around in the meantime:Replace all known query in the out folder with the encodeURI version: (i.e encodeURI(/[hash]/) will become /%5Bhash%5D/Decode the route in the lambda to read the file with the proper name fs.readFileSync(decodeURI(route))That was indeed a bad idea, there is too many occurences and sometimes it needs to be as-is in the code.
Additional context
The text was updated successfully, but these errors were encountered: