Skip to content

Commit 1680101

Browse files
glynnbirdGlynn Bird
andauthored
log before adding agents - fixes issue #252 (#253)
Co-authored-by: Glynn Bird <glynnbird@apache.org>
1 parent fb38c50 commit 1680101

File tree

3 files changed

+34
-26
lines changed

3 files changed

+34
-26
lines changed

lib/nano.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ module.exports = exports = function dbScope (cfg) {
365365
} else if (opts.dontParse) {
366366
req.responseType = 'arraybuffer'
367367
}
368-
req.httpAgent = cfg.requestDefaults.agent || defaultHttpAgent
369-
req.httpsAgent = cfg.requestDefaults.agent || defaultHttpsAgent
370368

371369
// scrub and log
372370
const scrubbedReq = JSON.parse(JSON.stringify(req))
@@ -377,6 +375,10 @@ module.exports = exports = function dbScope (cfg) {
377375
}
378376
log(scrubbedReq)
379377

378+
// add http agents
379+
req.httpAgent = cfg.requestDefaults.agent || defaultHttpAgent
380+
req.httpsAgent = cfg.requestDefaults.agent || defaultHttpsAgent
381+
380382
// actually do the HTTP request
381383
if (opts.stream) {
382384
// return the Request object for streaming

package-lock.json

Lines changed: 28 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "Apache-2.0",
55
"homepage": "http://github.com/apache/couchdb-nano",
66
"repository": "http://github.com/apache/couchdb-nano",
7-
"version": "9.0.2",
7+
"version": "9.0.3",
88
"author": "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)",
99
"keywords": [
1010
"couchdb",
@@ -17,6 +17,7 @@
1717
"database"
1818
],
1919
"dependencies": {
20+
"@types/tough-cookie": "^4.0.0",
2021
"axios": "^0.21.1",
2122
"axios-cookiejar-support": "^1.0.1",
2223
"qs": "^6.9.4",

0 commit comments

Comments
 (0)