mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 04:42:30 -04:00
check creds grant if non-creds is missing in CorsGate
This commit is contained in:
1 file changed
+12
-2
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user