From 572267802d42f061188e79dd448bc91bedfbc7eb Mon Sep 17 00:00:00 2001 From: Muki Kiboigo Date: Mon, 1 Jun 2026 07:36:13 -0700 Subject: [PATCH] fire RobotsBlocked in nextTickRun --- src/network/layer/RobotsLayer.zig | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/network/layer/RobotsLayer.zig b/src/network/layer/RobotsLayer.zig index a934adc5..6d979bfc 100644 --- a/src/network/layer/RobotsLayer.zig +++ b/src/network/layer/RobotsLayer.zig @@ -70,8 +70,21 @@ fn request(ptr: *anyopaque, transfer: *Transfer) anyerror!void { const path = URL.getPathname(url); if (!robots.isAllowed(path)) { - log.warn(.http, "blocked by robots", .{ .url = url }); - return error.RobotsBlocked; + try transfer.client.runNextTick( + transfer, + null, + .{ + .run = struct { + fn run(t: *Transfer, _: ?*anyopaque) void { + defer t.deinit(); + + log.warn(.http, "blocked by robots", .{ .url = t.req.url }); + t.req.error_callback(t.req.ctx, error.RobotsBlocked); + } + }.run, + }, + ); + return; } }, .absent => {},