Skip to content

Lightpanda: the headless browser designed for AI and automation

http: Change default max http size to 1GB (from unlimited)

Karl Seguin43b55b801364
diff --git a/src/help.zon b/src/help.zon
index e3d56c0eb..0ac6e3de6 100644
--- a/src/help.zon
+++ b/src/help.zon
@@ -314,7 +314,7 @@
\\ --http-max-response-size <INT>
\\ Limits the acceptable response size for any request
\\ e.g. XHR, fetch, script loading.
- \\ Defaults to no limit.
+ \\ Defaults to 1GB.
\\ --http-proxy <URL>
\\ HTTP proxy for all HTTP requests.
\\ username:password may be included for basic auth.
diff --git a/src/network/HttpClient.zig b/src/network/HttpClient.zig
index 1a60a2966..efc69b615 100644
--- a/src/network/HttpClient.zig
+++ b/src/network/HttpClient.zig
@@ -215,7 +215,7 @@ pub fn init(self: *Client, allocator: Allocator, network: *Network, cdp: ?*CDP)
.use_proxy = http_proxy != null,
.http_proxy = http_proxy,
.tls_verify = network.config.tlsVerifyHost(),
- .max_response_size = network.config.httpMaxResponseSize() orelse std.math.maxInt(u32),
+ .max_response_size = network.config.httpMaxResponseSize() orelse 1 * 1024 * 1024 * 1024, // 1GB
.serve_mode = network.config.mode == .serve,
.obey_robots = network.config.obeyRobots(),