+2
-5
lines changedFilter options
+2
-5
lines changed Original file line number Diff line number Diff line change
@@ -539,7 +539,6 @@ If no values are set, the following request headers will be sent automatically:
539
539
| ------------------- | ------------------------------------------------------ |
540
540
| `Accept-Encoding` | `gzip, deflate, br` (when `options.compress === true`) |
541
541
| `Accept` | `*/*` |
542
-
| `Connection` | `close` _(when no `options.agent` is present)_ |
543
542
| `Content-Length` | _(automatically calculated, if possible)_ |
544
543
| `Host` | _(host and port information from the target URI)_ |
545
544
| `Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ |
@@ -558,6 +557,8 @@ The `agent` option allows you to specify networking related options which are ou
558
557
559
558
See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
560
559
560
+
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.
561
+
561
562
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.
562
563
563
564
```js
Original file line number Diff line number Diff line change
@@ -288,10 +288,6 @@ export const getNodeRequestOptions = request => {
288
288
agent = agent(parsedURL);
289
289
}
290
290
291
-
if (!headers.has('Connection') && !agent) {
292
-
headers.set('Connection', 'close');
293
-
}
294
-
295
291
// HTTP-network fetch step 4.2
296
292
// chunked encoding is handled by Node.js
297
293
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