summaryrefslogtreecommitdiff
path: root/lib/_http_agent.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_http_agent.js')
-rw-r--r--lib/_http_agent.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/_http_agent.js b/lib/_http_agent.js
index 32dbf27abc..eb98f2b0bd 100644
--- a/lib/_http_agent.js
+++ b/lib/_http_agent.js
@@ -151,7 +151,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
if (options.socketPath)
options.path = options.socketPath;
- if (!options.servername)
+ if (!options.servername && options.servername !== '')
options.servername = calculateServerName(options, req);
const name = this.getName(options);
@@ -198,7 +198,7 @@ Agent.prototype.createSocket = function createSocket(req, options, cb) {
if (options.socketPath)
options.path = options.socketPath;
- if (!options.servername)
+ if (!options.servername && options.servername !== '')
options.servername = calculateServerName(options, req);
const name = this.getName(options);