Unverified Commit 2a96ee28 authored by Yichao 'Peak' Ji's avatar Yichao 'Peak' Ji Committed by Anatoli Papirovski
Browse files

url: fix WHATWG host formatting error

The current url.format implementation will return an invalid URL string
without the host if there is a port and unicode: true.

This unexpected behavior is caused by domainToUnicode, which expects
a hostname instead of a host string according to node_url.cc.

Adds both a fix and a test for the issue.

PR-URL: https://github.com/nodejs/node/pull/20493


Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarAnatoli Papirovski <apapirovski@mac.com>
Reviewed-By: default avatarTrivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: default avatarJoyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarDaijiro Wachi <daijiro.wachi@gmail.com>
parent 8f6ab9f7
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment