aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/server.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/api/server.zig')
-rw-r--r--src/bun.js/api/server.zig5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 809b35d32..f3b9425ef 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -2134,10 +2134,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
break :getter;
}
- req.body = .{ .InlineBlob = JSC.WebCore.InlineBlob.init(bytes.items) };
- var to_copy: []u8 = req.body.InlineBlob.bytes[bytes.items.len..];
- @memcpy(to_copy.ptr, chunk.ptr, chunk.len);
- req.body.InlineBlob.len += @truncate(JSC.WebCore.InlineBlob.IntSize, chunk.len);
+ req.body = .{ .InlineBlob = JSC.WebCore.InlineBlob.concat(bytes.items, chunk) };
this.request_body_buf.clearAndFree(this.allocator);
} else {
bytes.ensureTotalCapacityPrecise(this.allocator, total) catch |err| {