From 4afdc412eec21f03d24bc3e55a236f75965cb833 Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Wed, 23 Sep 2026 07:33:14 -0700 Subject: [PATCH] add cors-store-entry-limit option --- src/Config.zig | 8 ++++++++ src/help.zon | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/Config.zig b/src/Config.zig index 3562346c6..9dd641380 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -254,6 +254,7 @@ pub const ExperimentalFeatures = packed struct(u2) { const CommonOptions = .{ .{ .name = "obey_robots", .type = bool }, .{ .name = "robot_store_entry_limit", .type = ?u32, .default = 1000 }, + .{ .name = "cors_store_entry_limit", .type = ?u32, .default = 1000 }, .{ .name = "proxy_bearer_token", .type = ?[:0]const u8 }, .{ .name = "http_proxy", .type = ?[:0]const u8 }, .{ .name = "http_max_concurrent", .type = ?u8 }, @@ -570,6 +571,13 @@ pub fn robotStoreEntryLimit(self: *const Config) u32 { }; } +pub fn corsStoreEntryLimit(self: *const Config) u32 { + return switch (self.mode) { + inline .serve, .fetch, .mcp, .agent => |opts| opts.cors_store_entry_limit.?, + else => 1000, + }; +} + pub fn httpVersion(self: *const Config) HttpVersion { return switch (self.mode) { inline .serve, .fetch, .mcp, .agent => |opts| opts.http_version, diff --git a/src/help.zon b/src/help.zon index 4fcf2426d..65b9d323c 100644 --- a/src/help.zon +++ b/src/help.zon @@ -505,6 +505,9 @@ \\ --robot-store-entry-limit \\ Maximum number of entries kept in the RobotStore. 0 means no limit. \\ Defaults to 1000. + \\ --cors-store-entry-limit + \\ Maximum number of entries kept in the CorsStore. 0 means no limit. + \\ Defaults to 1000. \\ --proxy-bearer-token \\ Token sent for bearer authentication with the proxy: \\ Proxy-Authorization: Bearer .