http: add default argument for Agent.prototype.getName

PR-URL: https://github.com/nodejs/node/pull/41906
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
This commit is contained in:
小菜
2022-02-27 23:01:01 +08:00
committed by GitHub
parent 0f2ab70542
commit 04c68ba54a
5 changed files with 20 additions and 4 deletions

View File

@@ -203,7 +203,7 @@ Agent.prototype.createConnection = createConnection;
* }} [options]
* @returns {string}
*/
Agent.prototype.getName = function getName(options) {
Agent.prototype.getName = function getName(options = {}) {
let name = FunctionPrototypeCall(HttpAgent.prototype.getName, this, options);
name += ':';