GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http: should support userland Agent · nodejs/node@90403dd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • _http_client.js
  • test/parallel
    • test-http-client-reject-unexpected-agent.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/_http_client.js‎

Copy file name to clipboardExpand all lines: lib/_http_client.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ function ClientRequest(options, cb) {
8989
}
9090
// Explicitly pass through this statement as agent will not be used
9191
// when createConnection is provided.
92-
} else if (!(agent instanceof Agent.Agent)) {
92+
} else if (typeof agent.addRequest !== 'function') {
9393
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.'
9595
);
9696
}
9797
this.agent = agent;
Collapse file

‎test/parallel/test-http-client-reject-unexpected-agent.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-client-reject-unexpected-agent.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ server.listen(0, baseOptions.host, common.mustCall(function() {
4949
failingAgentOptions.forEach((agent) => {
5050
assert.throws(
5151
() => createRequest(agent),
52-
/^TypeError: Agent option must be an instance of http.Agent/,
52+
/^TypeError: Agent option must be an Agent-like object/,
5353
`Expected typeof agent: ${typeof agent} to be rejected`
5454
);
5555
});

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.