mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-08-02 10:47:15 -04:00
remove cors req from single flight on transfer deinit
This commit is contained in:
@@ -104,6 +104,10 @@ fn keyFor(arena: Allocator, transfer: *Transfer) ![]const u8 {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn remove(self: *CorsGate, transfer: *Transfer) void {
|
||||
self.single_flight.remove(transfer);
|
||||
}
|
||||
|
||||
pub fn check(self: *CorsGate, transfer: *Transfer) !Result {
|
||||
if (transfer.req.resource_type == .document) return .allowed;
|
||||
if (URL.isSameOrigin(transfer.req.url, transfer.req.cookie_origin)) return .allowed;
|
||||
|
||||
@@ -2138,10 +2138,14 @@ pub const Transfer = struct {
|
||||
self._dispatch_queued = false;
|
||||
}
|
||||
|
||||
// And for the robots gate: RobotsGate.pending holds a raw *Transfer
|
||||
// while we're parked.
|
||||
if (self.state == .parked and self.state.parked == .robots) {
|
||||
self.client.robots.remove(self);
|
||||
// And for the robots/cors gates: their single_flight.pending holds a raw
|
||||
// *Transfer while we're parked.
|
||||
if (self.state == .parked) {
|
||||
switch (self.state.parked) {
|
||||
.robots => self.client.robots.remove(self),
|
||||
.cors => self.client.cors.remove(self),
|
||||
.intercept_request, .intercept_auth => {},
|
||||
}
|
||||
}
|
||||
|
||||
// A pending revalidation entry owns cache resources (possibly an
|
||||
|
||||
Reference in New Issue
Block a user