summaryrefslogtreecommitdiff
path: root/lib/_http_client.js
diff options
context:
space:
mode:
authorfengmk2 <fengmk2@gmail.com>2017-02-27 01:09:30 +0800
committerJames M Snell <jasnell@gmail.com>2017-03-26 13:13:58 -0700
commit90403dd1d06d01ca69aea810bcaa7f41b031e8b4 (patch)
treec40d42ad6bc7bd66ab33c0ff7c1894849ab6bf3e /lib/_http_client.js
parent20b18236de3dff8a14ef8af8eed2c763f2d46f86 (diff)
downloadandroid-node-v8-90403dd1d06d01ca69aea810bcaa7f41b031e8b4.tar.gz
android-node-v8-90403dd1d06d01ca69aea810bcaa7f41b031e8b4.tar.bz2
android-node-v8-90403dd1d06d01ca69aea810bcaa7f41b031e8b4.zip
http: should support userland Agent
PR-URL: https://github.com/nodejs/node/pull/11567 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/_http_client.js')
-rw-r--r--lib/_http_client.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index d281b120c8..2205e89d2a 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -89,9 +89,9 @@ function ClientRequest(options, cb) {
}
// Explicitly pass through this statement as agent will not be used
// when createConnection is provided.
- } else if (!(agent instanceof Agent.Agent)) {
+ } else if (typeof agent.addRequest !== 'function') {
throw new TypeError(
- 'Agent option must be an instance of http.Agent, undefined or false.'
+ 'Agent option must be an Agent-like object, undefined, or false.'
);
}
this.agent = agent;