fix(azure): prefer `bufferBody` for request body
๐ Linked issue
resolves https://github.com/nitrojs/nitro/issues/3312
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [x] ๐ 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
This PR prefers req.bufferBody over req.rawBody for reading the raw request body, as per
https://github.com/Azure/azure-functions-nodejs-worker/issues/294.
Thanks @tomazs for suggesting this solution โค๏ธ
๐ Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Thanks for PR dear @kricsleo
Can you please retarget to v2 (considering #3208) also confirm if fix tested on prod?
(you can add a test to nitro-deploys that fails with current state)
confirm if fix tested on prod?
Verified locally, I don't have an Azure setup, and it seems the nitro-deploys don't either ๐
https://github.com/nitrojs/nitro-deploys?tab=readme-ov-file#providers
Azure Functions (docs | ~~deployment~~ )
Tests added: https://github.com/nitrojs/nitro-deploys/pull/115
| Before | After | |
|---|---|---|
dev |
||
build && func start |