Skip to content

Commit 1f3357b

Browse files
committed
Fix test_server_mode to explicitly bind to localhost
Previously this test passed port-only (e.g., '19876') which now binds to 0.0.0.0 (all interfaces) per Go convention. The test expects localhost binding, so explicitly specify '127.0.0.1:PORT' format.
1 parent 58fffee commit 1f3357b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/weak_integration.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ fn start_server(http_port: u16, https_port: u16) -> Result<std::process::Child,
181181
.arg("--js")
182182
.arg("true")
183183
.arg("-vv")
184-
.env("HTTPJAIL_HTTP_BIND", http_port.to_string())
185-
.env("HTTPJAIL_HTTPS_BIND", https_port.to_string())
184+
.env("HTTPJAIL_HTTP_BIND", format!("127.0.0.1:{}", http_port))
185+
.env("HTTPJAIL_HTTPS_BIND", format!("127.0.0.1:{}", https_port))
186186
.env("HTTPJAIL_SKIP_KEYCHAIN_INSTALL", "1") // Skip automatic keychain installation during tests
187187
.stdout(Stdio::null())
188188
.stderr(Stdio::null());
@@ -337,7 +337,10 @@ fn test_server_bind_defaults() {
337337
fn test_server_bind_port_only() {
338338
// Port-only should bind to all interfaces (0.0.0.0)
339339
let (mut server, port) = start_server_with_bind("19882", "19883");
340-
assert_eq!(port, 19882, "Server should bind to specified port on all interfaces");
340+
assert_eq!(
341+
port, 19882,
342+
"Server should bind to specified port on all interfaces"
343+
);
341344
server.kill().ok();
342345
}
343346

0 commit comments

Comments
 (0)