-
-
Notifications
You must be signed in to change notification settings - Fork 715
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Reproducible By
$ node
Welcome to Node.js v18.13.0.
Type ".help" for more information.
> const { fetch } = require('undici');
undefined
> await fetch("https://bing.com/translator", { headers: { host: 'bing.com' } });
Uncaught TypeError: fetch failed
at fetch ($PWD/node_modules/undici/index.js:110:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async REPL2:1:33 {
cause: Error: Client network socket disconnected before secure TLS connection was established
at connResetException (node:internal/errors:718:14)
at TLSSocket.onConnectEnd (node:_tls_wrap:1600:19)
at TLSSocket.emit (node:events:525:35)
at TLSSocket.emit (node:domain:552:15)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ECONNRESET',
path: undefined,
host: 'www.bing.com',
port: 443,
localAddress: null
}
}
> await fetch("https://bing.com/translator");
Response {
[Symbol(realm)]: null,
[ .. all good without explicit host: .. ]
The bug happens with bing.com because it tries to redirect to www.bing.com; it doesn't happen for domains that don't redirect, such as fanyi.baidu.com.
Environment
| software | version |
|---|---|
| undici | v5.25.4 |
| node | v18.13.0 |
| Operating System | Debian GNU/Linux trixie/sid |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working