Skip to content

Commit 36e29e2

Browse files
committed
1 parent ff3bc55 commit 36e29e2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/cmd/zpm.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ pub fn server_fetch(url: string) !json.Document {
6868
try req.sendBodiless();
6969
var resp = try req.receiveHead(&.{});
7070
if (resp.head.status != .ok) u.fail("expected: 200 from '{s}' got: {s}", .{ url, @tagName(resp.head.status) });
71-
return json.parse(gpa, "", nio.AnyReadable.fromStd(resp.reader(&buf)), .{ .support_trailing_commas = true, .maximum_depth = 100 });
71+
const content = try resp.reader(&buf).allocRemaining(gpa, .limited(1024 * 1024 * 5));
72+
return json.parseFromSlice(gpa, "", content, .{ .support_trailing_commas = true, .maximum_depth = 100 });
7273
}
7374

7475
pub fn server_fetchArray(url: string) ![]const Package {

0 commit comments

Comments
 (0)