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: keep request option copies in fast mode · nodejs/node@7007c63

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • https.js
    • internal/http
      • agent.js
      • client.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/https.js‎

Copy file name to clipboardExpand all lines: lib/https.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ function Agent(options) {
494494
if (!(this instanceof Agent))
495495
return new Agent(options);
496496

497-
options = { __proto__: null, ...options };
497+
options = { __proto__: kEmptyObject, ...options };
498498
validateOpenSSLEngineOptions(options);
499499
options.defaultPort ??= 443;
500500
options.protocol ??= 'https:';
Collapse file

‎lib/internal/http/agent.js‎

Copy file name to clipboardExpand all lines: lib/internal/http/agent.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function Agent(options) {
172172

173173
EventEmitter.call(this);
174174

175-
this.options = { __proto__: null, ...options };
175+
this.options = { __proto__: kEmptyObject, ...options };
176176

177177
this.defaultPort = this.options.defaultPort || 80;
178178
this.protocol = this.options.protocol || 'http:';
@@ -395,7 +395,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
395395
}
396396

397397
// Here the agent options will override per-request options.
398-
options = { __proto__: null, ...options, ...this.options };
398+
options = { __proto__: kEmptyObject, ...options, ...this.options };
399399
if (options.socketPath)
400400
options.path = options.socketPath;
401401

@@ -472,7 +472,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
472472

473473
Agent.prototype.createSocket = function createSocket(req, options, cb) {
474474
// Here the agent options will override per-request options.
475-
options = { __proto__: null, ...options, ...this.options };
475+
options = { __proto__: kEmptyObject, ...options, ...this.options };
476476
if (options.socketPath)
477477
options.path = options.socketPath;
478478

Collapse file

‎lib/internal/http/client.js‎

Copy file name to clipboardExpand all lines: lib/internal/http/client.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const {
2626
Boolean,
2727
Error,
2828
NumberIsFinite,
29-
ObjectAssign,
3029
ObjectDefineProperty,
3130
ObjectHasOwn,
3231
ObjectKeys,
@@ -365,7 +364,8 @@ function ClientRequest(input, options, cb) {
365364
pathIsFromURL = false;
366365
}
367366

368-
options = ObjectAssign({ __proto__: null }, input, options);
367+
// Avoid creating a dictionary-mode object.
368+
options = { __proto__: kEmptyObject, ...input, ...options };
369369
}
370370

371371
// Propagate the user's highWaterMark to OutgoingMessage so that
@@ -413,7 +413,7 @@ function ClientRequest(input, options, cb) {
413413
const defaultPort = options.defaultPort ||
414414
(this.agent?.defaultPort);
415415

416-
const optsWithoutSignal = { __proto__: null, ...options };
416+
const optsWithoutSignal = { __proto__: kEmptyObject, ...options };
417417

418418
const port = optsWithoutSignal.port = options.port || defaultPort || 80;
419419
const host = optsWithoutSignal.host = validateHost(options.hostname, 'hostname') ||

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.