diff options
author | 2023-04-17 05:46:44 -0700 | |
---|---|---|
committer | 2023-04-17 05:46:44 -0700 | |
commit | d19005aa762b55114d26dabe4931a8c8aa3bfaae (patch) | |
tree | f721e70bb0b37f982a25bc686bb528190a9c6407 /src/bun.js/api/server.zig | |
parent | d2c64300f61d0eedf86017396dbfa56db0200bfb (diff) | |
download | bun-d19005aa762b55114d26dabe4931a8c8aa3bfaae.tar.gz bun-d19005aa762b55114d26dabe4931a8c8aa3bfaae.tar.zst bun-d19005aa762b55114d26dabe4931a8c8aa3bfaae.zip |
Fix access of inactive union field
Diffstat (limited to 'src/bun.js/api/server.zig')
-rw-r--r-- | src/bun.js/api/server.zig | 7 |
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 = {} }; } } |