mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
Fix for issue denoland/deno#6685: --allow-net=:8080 broken (denoland/deno#6698)
This commit is contained in:
parent
fae1aba117
commit
2cda6fbd3c
@ -263,7 +263,7 @@ export function _parseAddrFromStr(addr: string): HTTPOptions {
|
||||
}
|
||||
|
||||
return {
|
||||
hostname: url.hostname,
|
||||
hostname: url.hostname == "" ? "0.0.0.0" : url.hostname,
|
||||
port: url.port === "" ? 80 : Number(url.port),
|
||||
};
|
||||
}
|
||||
|
@ -665,5 +665,6 @@ Deno.test({
|
||||
fn: (): void => {
|
||||
const addr = _parseAddrFromStr(":80");
|
||||
assertEquals(addr.port, 80);
|
||||
assertEquals(addr.hostname, "0.0.0.0");
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user