Skip to content

Commit 1abce92

Browse files
committed
change false => ''
1 parent c85a7eb commit 1abce92

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/api/https.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ An [`Agent`][] object for HTTPS similar to [`http.Agent`][]. See
2929
Can have the same fields as for [`http.Agent(options)`][], and
3030
* `maxCachedSessions` {number} maximum number of TLS cached sessions.
3131
Use `0` to disable TLS session caching. **Default:** `100`.
32-
* `servername` {string | boolean} the value of
32+
* `servername` {string} the value of
3333
[Server Name Indication extension][sni wiki] to be sent to the server. Use
34-
`false` to disable sending the extension.
34+
empty string `''` to disable sending the extension.
3535
**Default:** hostname or IP address of the target server.
3636

3737
See [`Session Resumption`][] for infomation about TLS session reuse.

lib/_http_agent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
151151
if (options.socketPath)
152152
options.path = options.socketPath;
153153

154-
if (!options.servername && options.servername !== false)
154+
if (!options.servername && options.servername !== '')
155155
options.servername = calculateServerName(options, req);
156156

157157
const name = this.getName(options);
@@ -198,7 +198,7 @@ Agent.prototype.createSocket = function createSocket(req, options, cb) {
198198
if (options.socketPath)
199199
options.path = options.socketPath;
200200

201-
if (!options.servername && options.servername !== false)
201+
if (!options.servername && options.servername !== '')
202202
options.servername = calculateServerName(options, req);
203203

204204
const name = this.getName(options);

test/parallel/test-https-agent-sni.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ server.listen(0, function() {
5656
path: '/',
5757
port: this.address().port,
5858
host: '127.0.0.1',
59-
servername: false,
59+
servername: '',
6060
rejectUnauthorized: false
6161
}, expectResponse(false));
6262
});

0 commit comments

Comments
 (0)