mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-08 12:21:44 -04:00
move body ensure capacity before optional header copy
This commit is contained in:
1 parent
1dfd8ef89e
commit
93ef6eb7bf
1 file changed
+4
-4
@@ -1457,6 +1457,10 @@ const SyncContext = struct {
|
||||
const body_len = transfer.bodyLen();
|
||||
const allocator = try self.bodyAllocator(body_len);
|
||||
|
||||
if (body_len > 0) {
|
||||
try self.body.ensureTotalCapacityPrecise(allocator, body_len);
|
||||
}
|
||||
|
||||
if (self.options.copy_headers) {
|
||||
var it = transfer.responseHeaderIterator();
|
||||
while (it.next()) |hdr| {
|
||||
@@ -1466,10 +1470,6 @@ const SyncContext = struct {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (body_len > 0) {
|
||||
try self.body.ensureTotalCapacityPrecise(allocator, body_len);
|
||||
}
|
||||
return .proceed;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user