mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
fix(http): show hostname as 'localhost' for 0.0.0.0 on windows (#5918)
This commit is contained in:
parent
149839b60c
commit
fb79076121
@ -849,7 +849,10 @@ function main() {
|
||||
networkAddress = getNetworkAddress();
|
||||
}
|
||||
const protocol = useTls ? "https" : "http";
|
||||
let message = `Listening on:\n- Local: ${protocol}://${hostname}:${port}`;
|
||||
const host = (Deno.build.os === "windows" && hostname === "0.0.0.0")
|
||||
? "localhost"
|
||||
: hostname;
|
||||
let message = `Listening on:\n- Local: ${protocol}://${host}:${port}`;
|
||||
if (networkAddress && !DENO_DEPLOYMENT_ID) {
|
||||
message += `\n- Network: ${protocol}://${networkAddress}:${port}`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user