-
Notifications
You must be signed in to change notification settings - Fork 125
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
change querystring format for multi value parameters (#319) #320
Conversation
Signed-off-by: Thomas Altmann <thomas.altmann.extern@porsche.digital>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have an idea but I'm not sure why my change would cause the behavior: in So, some middleware functions add a parameter with e.g. But that would have been the behavior before too I think, so I'm not really sure if that's actually the problem. I'm not that familiar with which events contain which fields and when a request ends up in one or the other function, so I'm mostly guessing. Do you have any other ideas? |
@@ -154,7 +153,7 @@ export function handleRewrites<T extends RewriteDefinition>( | |||
} | |||
} | |||
|
|||
const queryString = urlQueryString ? `?${urlQueryString}` : ""; | |||
const queryString = query ? `?${convertToQueryString(query)}` : ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue might be here, query here could be {}
, this will evaluate to true.
This does not explain why query.test.ts
fails though.
My bet is that it comes from here https://github.com/sst/open-next/blob/8bc075b9696857d60ffe520154b8395c3a730b00/packages/open-next/src/adapters/event-mapper.ts#L126
You should probably try deploying and add a bunch of console.logs to try to understand why it fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I've changed this and moved the ternary logic to the utility-function direclty. i got it deployed and still have one failing e2e test in the query.test.ts, unfortunately with exactly the same error we currently have. But I'll just log everything I can and see where I end up
Signed-off-by: Thomas Altmann <thomas.altmann.extern@porsche.digital>
Signed-off-by: Thomas Altmann <thomas.altmann.extern@porsche.digital>
With the last commit I changed how the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks
Changes querystrings with multi-value parameters from
"?key=value1,value2"
to?key=value1&key=value2
since NextJS understands this format and converts it to an array when reading search params.