Skip to content

Commit 93af870

Browse files
TuntiiCopilot
andauthored
Update crates/rustapi-core/src/app.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e598eef commit 93af870

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/rustapi-core/src/app.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,11 @@ impl RustApi {
11151115
.ok_or("HTTP/3 config not set. Use .with_http3(...)")?;
11161116

11171117
let http_socket: std::net::SocketAddr = http_addr.parse()?;
1118-
config.bind_addr = http_socket.ip().to_string();
1118+
config.bind_addr = if http_socket.ip().is_ipv6() {
1119+
format!("[{}]", http_socket.ip())
1120+
} else {
1121+
http_socket.ip().to_string()
1122+
};
11191123
config.port = http_socket.port();
11201124
let http_addr = http_socket.to_string();
11211125

0 commit comments

Comments
 (0)