From 2a58ab4f09e1dbaf5685d88c9ef7119d441a97a7 Mon Sep 17 00:00:00 2001 From: Jack Wink <57678801+mothershipper@users.noreply.github.com> Date: Mon, 13 Apr 2026 14:41:24 -0400 Subject: [PATCH] fix(node-layer): Fixes file upload handling PR #479 attempted to fix requests where the body was null/undefined by setting the GOT body to an empty string - however, this wiped out the body being set by the file handling cases before this logic. This commit adds a check to confirm that gotBody is falsy before setting it to an empty string, preserving the file body. --- lib/node/node-layer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node/node-layer.js b/lib/node/node-layer.js index c9798e7..1c54964 100644 --- a/lib/node/node-layer.js +++ b/lib/node/node-layer.js @@ -62,7 +62,8 @@ function createRequestStreams(request) { if ( ['POST', 'PUT', 'PATCH', 'DELETE'].includes(request.method) && - !request.body + !request.body && + !gotOptions.body ) { gotOptions.body = ''; }