+2
-5
lines changedFilter options
+2
-5
lines changed Original file line number Diff line number Diff line change
@@ -387,7 +387,6 @@ Header | Value
387
387
------------------- | --------------------------------------------------------
388
388
`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_
389
389
`Accept` | `*/*`
390
-
`Connection` | `close` _(when no `options.agent` is present)_
391
390
`Content-Length` | _(automatically calculated, if possible)_
392
391
`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_
393
392
`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)`
@@ -404,6 +403,8 @@ The `agent` option allows you to specify networking related options which are ou
404
403
405
404
See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
406
405
406
+
If no agent is specified, the default agent provided by Node.js is used. Note that [this changed in Node.js 19](https://github.com/nodejs/node/blob/4267b92604ad78584244488e7f7508a690cb80d0/lib/_http_agent.js#L564) to have `keepalive` true by default. If you wish to enable `keepalive` in an earlier version of Node.js, you can override the agent as per the following code sample.
407
+
407
408
In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
408
409
409
410
```js
Original file line number Diff line number Diff line change
@@ -258,10 +258,6 @@ export function getNodeRequestOptions(request) {
258
258
agent = agent(parsedURL);
259
259
}
260
260
261
-
if (!headers.has('Connection') && !agent) {
262
-
headers.set('Connection', 'close');
263
-
}
264
-
265
261
// HTTP-network fetch step 4.2
266
262
// chunked encoding is handled by Node.js
267
263
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4