aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bun.js/api/server.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 1390a4aa8..40a78f5c2 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -5003,13 +5003,14 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type {
},
};
resp.onData(*RequestContext, RequestContext.onBufferedBodyChunk, ctx);
- } else {
- // no content-length or 0 content-length
- // no transfer-encoding
+ } else if (request_object.body == .Locked) {
+ // This branch should never be taken, but we are handling it anyway.
var old = request_object.body;
old.Locked.onReceiveValue = null;
request_object.body = .{ .Null = {} };
old.resolve(&request_object.body, this.globalThis);
+ } else {
+ request_object.body = .{ .Null = {} };
}
}