Commit 2a54965
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: #20493
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>1 parent 931408e commit 2a54965Copy full SHA for 2a54965
File tree
Expand file treeCollapse file tree
2 files changed
+8
-1
lines changedOpen diff view settings
Filter options
- lib/internal
- test/parallel
Expand file treeCollapse file tree
2 files changed
+8
-1
lines changedOpen diff view settings
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
400 | 400 | |
401 | 401 | |
402 | 402 | |
403 | | - |
| 403 | + |
| 404 | + |
| 405 | + |
404 | 406 | |
405 | 407 | |
406 | 408 | |
|
Collapse file
test/parallel/test-url-format-whatwg.js
Copy file name to clipboardExpand all lines: test/parallel/test-url-format-whatwg.js+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
111 | 111 | |
112 | 112 | |
113 | 113 | |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
0 commit comments