aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api/server.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-10-15 21:03:40 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-10-15 21:03:40 -0700
commit63c9315b24910095b76c7a01c3129c3500a2a5ad (patch)
tree4a0eeddc9dc0631db99c54bf25be45ed3e30efa2 /src/bun.js/api/server.zig
parent40126bbe60df2aaaad1d6be28f27ba255a1ba6d0 (diff)
downloadbun-63c9315b24910095b76c7a01c3129c3500a2a5ad.tar.gz
bun-63c9315b24910095b76c7a01c3129c3500a2a5ad.tar.zst
bun-63c9315b24910095b76c7a01c3129c3500a2a5ad.zip
Add a helper for InlineBlob from two arrays
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| {