Subdomains on localhost return ENOTFOUND on some OS.
未关闭
还没有人认领这个 Issue。
dns
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.3k
- 平均合并
- 4 天 2 小时
- 30 天内合并 PR
- 283
描述
Version
Tested on v21.2.0, v20.9.0, v18.18.2
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
- run
fetch("http://test.localhost/")
How often does it reproduce? Is there a required condition?
Happens on windows every time
What is the expected behavior? Why is that the expected behavior?
Expected behaviour is ECONNREFUSED or content of what the webpage contains equally to how a node on Linux, cURL or a browser would handle it
What do you see instead?
Uncaught [TypeError: fetch failed] {
cause: Error: getaddrinfo ENOTFOUND test.localhost
at GetAddrInfoReqWrap.onlookupall [as complete] (node:dns:118:26)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'test.localhost'
}
}
Additional information
Recreated locally in a VM but also on an actual Windows device
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先在 Windows 上重现 fetch("http://test.localhost/"),并检查为 test.localhost 产生 ENOTFOUND 的 node:dns 解析路径。将其行为与 Linux、cURL 或浏览器进行比较,并在 Windows 的行为符合预期的 localhost 处理且有回归测试覆盖时,认为该 issue 已完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nodejs
- 领域
- networking
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100