-
Notifications
You must be signed in to change notification settings - Fork 53
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 community.
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
Inconsistent request.uri()
Behaviour in Dynamic Catch-All Routes
#126
Comments
[UPDATE] It seems the issue stems from lack of support for both {
"functions": {
"api/**/*.rs": {
"runtime": "[email protected]"
}
},
"rewrites": [
{
"source": "/(.*)",
"destination": "/api/$1"
}
]
} This means this issue relates to #121 except, I'm not making use of the bundling api |
request.uri()
Behaviour in Catch-All Routesrequest.uri()
Behaviour in Dynamic Catch-All Routes
Further investigation shows that the issue described above has nothing to do with For anyone who may not be aware, there are two possible catch all routes file names which this runtime supports:
Until this issue is fixed (I may open a PR if I have the time), if you're experiencing this same issue, you can switch to making use of an optional catch all route which is more friendly IMO 😅 |
sadly this is still a problem. I found something that is in connection with your described issue. I have a route as such: api\categories[category_id]\details.rs On the first invocation [category_id] is resolved correctly, but on the second one its not mapped correctly and only literally say I was checking the logs and it turns out that it is mapping this call to on the first call So it appends the param as a query for some reason |
Yes, I noticed this too. The param seems to be resolved only once. The work around for me was to use the optional catch all route where the param is resolved always |
Problem Description:
I am currently implementing a catch-all route in my project using this runtime. Within the handler for this catch-all route, I need to access the request URI using
request.uri()
.Issue Details:
request.uri()
correctly returns the expected path, such as "/hello."request.uri()
function now returns "/api/[...all]" instead of the expected path as shown in the snippet below:This behavior is unexpected and inconsistent, as I would expect
request.uri()
to consistently return the path of the current request. I have reviewed my vercel configuration and am confident that it's not causing this issue. Here's myvercel.json
JIC.Steps to Reproduce:
request.uri()
.request.uri()
, which may now be unexpected.Expected Behavior:
request.uri()
should consistently return the correct path for the current request, regardless of how many times the page is refreshed or navigated.Environment:
I appreciate any insights or suggestions on resolving this issue. Thank you!
The text was updated successfully, but these errors were encountered: