Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 920a53b

Browse files
kricsleopi0
authored andcommitted
fix(azure): prefer bodyBuffer for request body (nitrojs#3375)
1 parent 6d2ec75 commit 920a53b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/presets/azure/runtime/azure-swa.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ export async function handle(context: { res: HttpResponse }, req: HttpRequest) {
2525

2626
const response = await nitroApp.fetch(url, {
2727
method: req.method || undefined,
28-
headers: req.headers,
29-
body: req.rawBody, // https://github.com/Azure/azure-functions-host/issues/293
28+
// https://github.com/Azure/azure-functions-nodejs-worker/issues/294
29+
// https://github.com/Azure/azure-functions-host/issues/293
30+
body: req.bufferBody ?? req.rawBody,
3031
});
3132

3233
// (v3 - current) https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=typescript%2Cwindows%2Cazure-cli&pivots=nodejs-model-v3#http-response

0 commit comments

Comments
 (0)