| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,9 +89,9 @@ function ClientRequest(options, cb) { | |||
| 89 | 89 | } | |
| 90 | 90 | // Explicitly pass through this statement as agent will not be used | |
| 91 | 91 | // when createConnection is provided. | |
| 92 | - } else if (!(agent instanceof Agent.Agent)) { | ||
| 92 | + } else if (typeof agent.addRequest !== 'function') { | ||
| 93 | 93 | throw new TypeError( | |
| 94 | - 'Agent option must be an instance of http.Agent, undefined or false.' | ||
| 94 | + 'Agent option must be an Agent-like object, undefined, or false.' | ||
| 95 | 95 | ); | |
| 96 | 96 | } | |
| 97 | 97 | this.agent = agent; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,7 +49,7 @@ server.listen(0, baseOptions.host, common.mustCall(function() { | |||
| 49 | 49 | failingAgentOptions.forEach((agent) => { | |
| 50 | 50 | assert.throws( | |
| 51 | 51 | () => createRequest(agent), | |
| 52 | - /^TypeError: Agent option must be an instance of http.Agent/, | ||
| 52 | + /^TypeError: Agent option must be an Agent-like object/, | ||
| 53 | 53 | `Expected typeof agent: ${typeof agent} to be rejected` | |
| 54 | 54 | ); | |
| 55 | 55 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments