mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
fix(http): invalid ipv6 hostname printed to console (#5924)
This commit is contained in:
parent
b3e1ebb75f
commit
9f19c9afa1
@ -842,7 +842,10 @@ function main() {
|
||||
const host = (Deno.build.os === "windows" && hostname === "0.0.0.0")
|
||||
? "localhost"
|
||||
: hostname;
|
||||
let message = `Listening on:\n- Local: ${protocol}://${host}:${port}`;
|
||||
|
||||
const formattedHost = hostname.includes(":") ? `[${host}]` : host;
|
||||
let message =
|
||||
`Listening on:\n- Local: ${protocol}://${formattedHost}:${port}`;
|
||||
if (networkAddress && !DENO_DEPLOYMENT_ID) {
|
||||
message += `\n- Network: ${protocol}://${networkAddress}:${port}`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user