nitro
nitro copied to clipboard
fix(azure_functions): preserve query string in adapter handler
๐ Linked issue
- Resolves #3588
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
The azure_functions preset discards query parameters when constructing the
URL passed to nitroApp.localCall. Currently it only uses:
const url = "/" + (req.params.url || "");
As a result, any query string is lost (getQuery(event) always returned {}).
This PR updates the handler to preserve the query portion from req.url
(if present):
let path = "/" + (req.params.url || "");
if (req.url && req.url.includes("?")) {
path += req.url.slice(req.url.indexOf("?"));
}
๐ Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
@xMorthi is attempting to deploy a commit to the Nitro Team on Vercel.
A member of the Team first needs to authorize it.