Skip to content

Commit

Permalink
change false => ''
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Apr 27, 2019
1 parent c85a7eb commit 1abce92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ An [`Agent`][] object for HTTPS similar to [`http.Agent`][]. See
Can have the same fields as for [`http.Agent(options)`][], and
* `maxCachedSessions` {number} maximum number of TLS cached sessions.
Use `0` to disable TLS session caching. **Default:** `100`.
* `servername` {string | boolean} the value of
* `servername` {string} the value of
[Server Name Indication extension][sni wiki] to be sent to the server. Use
`false` to disable sending the extension.
empty string `''` to disable sending the extension.
**Default:** hostname or IP address of the target server.

See [`Session Resumption`][] for infomation about TLS session reuse.
Expand Down
4 changes: 2 additions & 2 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
if (options.socketPath)
options.path = options.socketPath;

if (!options.servername && options.servername !== false)
if (!options.servername && options.servername !== '')
options.servername = calculateServerName(options, req);

const name = this.getName(options);
Expand Down Expand Up @@ -198,7 +198,7 @@ Agent.prototype.createSocket = function createSocket(req, options, cb) {
if (options.socketPath)
options.path = options.socketPath;

if (!options.servername && options.servername !== false)
if (!options.servername && options.servername !== '')
options.servername = calculateServerName(options, req);

const name = this.getName(options);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-agent-sni.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ server.listen(0, function() {
path: '/',
port: this.address().port,
host: '127.0.0.1',
servername: false,
servername: '',
rejectUnauthorized: false
}, expectResponse(false));
});

0 comments on commit 1abce92

Please sign in to comment.