Skip to content

Lightpanda: the headless browser designed for AI and automation

config: only flag wildcard bind when no --advertise-host is set

Pierre Tachoireb340071d0311
diff --git a/src/Config.zig b/src/Config.zig
index 55ceab8ba..699402da4 100644
--- a/src/Config.zig
+++ b/src/Config.zig
@@ -689,7 +689,7 @@ fn advertiseHostFallback(host: []const u8) []const u8 {
// resolvable, but the caller still benefits from emitting a guidance log.
pub fn bindIsWildcard(self: *const Config) bool {
return switch (self.mode) {
- .serve => |opts| isHostWildcard(opts.host),
+ .serve => |opts| opts.advertise_host == null and isHostWildcard(opts.host),
else => false,
};
}
@@ -1037,7 +1037,8 @@ test "Config: advertiseHost honors explicit --advertise-host override" {
.advertise_host = "192.168.0.5",
} });
defer config.deinit(std.testing.allocator);
- try std.testing.expect(config.bindIsWildcard());
+ // The explicit --advertise-host silences the wildcard guidance log.
+ try std.testing.expect(!config.bindIsWildcard());
try std.testing.expectEqualStrings("192.168.0.5", config.advertiseHost());
}