check creds grant if non-creds is missing in CorsGate

This commit is contained in:
Muki Kiboigo committed 2026-09-23 08:00:54 -07:00
1 parent d6cbea9b1a
commit 1ae01f3fc2
1 file changed
+12 -2
+12 -2
View File
@@ -220,11 +220,21 @@ pub fn check(self: *CorsGate, transfer: *Transfer) !Result {
const wants_credentials = req.credentials_mode == .include;
const authored = try collectAuthoredHeaders(transfer, transfer.arena.allocator());
if (try self.network.cors_store.covers(.{
var covered = try self.network.cors_store.covers(.{
.origin = origin,
.target = req.url,
.credentials = wants_credentials,
}, req.method, authored.items)) {
}, req.method, authored.items);
if (!covered and !wants_credentials) {
covered = try self.network.cors_store.covers(.{
.origin = origin,
.target = req.url,
.credentials = true,
}, req.method, authored.items);
}
if (covered) {
log.debug(.cors, "cross origin", .{
.url = req.url,
.origin = origin,