diff options
author | 2022-10-15 21:03:40 -0700 | |
---|---|---|
committer | 2022-10-15 21:03:40 -0700 | |
commit | 63c9315b24910095b76c7a01c3129c3500a2a5ad (patch) | |
tree | 4a0eeddc9dc0631db99c54bf25be45ed3e30efa2 /src/bun.js/api/server.zig | |
parent | 40126bbe60df2aaaad1d6be28f27ba255a1ba6d0 (diff) | |
download | bun-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.zig | 5 |
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| { |