From cc4bd417d23d46ce90f2738ce10ccf34cf0b59ab Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 14 Apr 2026 15:56:40 -0400 Subject: [PATCH] save cookies at the end of fetch --- src/lightpanda.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lightpanda.zig b/src/lightpanda.zig index 8ec24a84..444d0537 100644 --- a/src/lightpanda.zig +++ b/src/lightpanda.zig @@ -74,8 +74,8 @@ pub fn fetch(app: *App, url: [:0]const u8, opts: FetchOpts) !void { }; } - if (app.config.cookieJarFile()) |cookie_jar_path| { - defer { + defer { + if (app.config.cookieJarFile()) |cookie_jar_path| { cookies.saveToFile(&session.cookie_jar, cookie_jar_path) catch |err| { log.err(.app, "cookie save error", .{ .err = err }); };