Skip to content

Lightpanda: the headless browser designed for AI and automation

mask url fields from crash report

Pierre Tachoireec16da49e37f
diff --git a/src/crash_handler.zig b/src/crash_handler.zig
index 41200409b..b3b86c41a 100644
--- a/src/crash_handler.zig
+++ b/src/crash_handler.zig
@@ -101,6 +101,11 @@ fn report(reason: []const u8, begin_addr: usize, args: anytype) !void {
const body = blk: {
var writer: std.Io.Writer = .fixed(body_buffer[0..8191]); // reserve 1 space
inline for (@typeInfo(@TypeOf(args)).@"struct".fields) |f| {
+ // remove url value from the crash report.
+ if (comptime std.mem.eql(u8, f.name, "url")) {
+ writer.writeAll("url: REDACTED\n") catch break;
+ continue;
+ }
writer.writeAll(f.name ++ ": ") catch break;
lp.log.writeValue(.pretty, @field(args, f.name), &writer) catch {};
writer.writeByte('\n') catch {};