diff options
author | Evan Bertrand <67847790+3bert@users.noreply.github.com> | 2020-07-09 03:37:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 03:37:50 -0400 |
commit | e92cf5b9e8530f7edf5cb7b157e6334a013da10d (patch) | |
tree | 59590bec3b3d4eb5056eb467a7c5b56e58a2f421 /std/http/server.ts | |
parent | be7e0f2d490ca480aaa154845c4c5c6dccbd7546 (diff) |
fix(std/http): properly return port 80 in _parseAddrFromStr (#6635)
Diffstat (limited to 'std/http/server.ts')
-rw-r--r-- | std/http/server.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/std/http/server.ts b/std/http/server.ts index 82e5f8169..cc0c7cca3 100644 --- a/std/http/server.ts +++ b/std/http/server.ts @@ -262,7 +262,10 @@ export function _parseAddrFromStr(addr: string): HTTPOptions { throw new TypeError("Invalid address."); } - return { hostname: url.hostname, port: Number(url.port) }; + return { + hostname: url.hostname, + port: url.port === "" ? 80 : Number(url.port), + }; } /** |