nitro icon indicating copy to clipboard operation
nitro copied to clipboard

fix(azure): prefer `bufferBody` for request body

Open kricsleo opened this issue 7 months ago โ€ข 2 comments

๐Ÿ”— 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.

kricsleo avatar May 28 '25 14:05 kricsleo

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)

pi0 avatar May 28 '25 15:05 pi0

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 image image
build && func start image image

kricsleo avatar May 29 '25 14:05 kricsleo