Lightpanda: the headless browser designed for AI and automation
authorization header doesnt accept wildcard
Muki Kiboigo2b06583662c9
diff --git a/src/network/CorsGate.zig b/src/network/CorsGate.zigindex e5165eb24..b3f43ff1e 100644--- a/src/network/CorsGate.zig+++ b/src/network/CorsGate.zig@@ -302,17 +302,19 @@ const CorsPreflightContext = struct {};const headers_wildcard = std.mem.eql(u8, allow_headers, "*") and !self.wants_credentials;- if (!headers_wildcard) {- for (self.request_headers) |name| {- if (!headerAllowed(allow_headers, name)) {- log.debug(.cors, "preflight blocked", .{- .url = self.url,- .reason = "header not allowed",- .allow_headers = allow_headers,- .header = name,- });- return false;- }++ for (self.request_headers) |name| {+ const is_authorization = std.ascii.eqlIgnoreCase(name, "authorization");+ if (headers_wildcard and !is_authorization) continue;++ if (!headerAllowed(allow_headers, name)) {+ log.debug(.cors, "preflight blocked", .{+ .url = self.url,+ .reason = "header not allowed",+ .allow_headers = allow_headers,+ .header = name,+ });+ return false;}}}