From 9e934ea81318293185da860eec94bf9648006b5a Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 3 Apr 2017 02:55:01 +0300 Subject: [PATCH 1/3] doc: replace `var` by `const` in https.md --- doc/api/https.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/https.md b/doc/api/https.md index 7cbb5fd3429a81..4b23e9abc548e9 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -167,14 +167,14 @@ Example: ```js const https = require('https'); -var options = { +const options = { hostname: 'encrypted.google.com', port: 443, path: '/', method: 'GET' }; -var req = https.request(options, (res) => { +const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); @@ -191,7 +191,7 @@ req.end(); Example using options from [`tls.connect()`][]: ```js -var options = { +const options = { hostname: 'encrypted.google.com', port: 443, path: '/', @@ -201,7 +201,7 @@ var options = { }; options.agent = new https.Agent(options); -var req = https.request(options, (res) => { +const req = https.request(options, (res) => { ... }); ``` @@ -211,7 +211,7 @@ Alternatively, opt out of connection pooling by not using an `Agent`. Example: ```js -var options = { +const options = { hostname: 'encrypted.google.com', port: 443, path: '/', @@ -221,7 +221,7 @@ var options = { agent: false }; -var req = https.request(options, (res) => { +const req = https.request(options, (res) => { ... }); ``` From 790dbff0b6e3f3e279d3f8a89c9c7ccbab507419 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 3 Apr 2017 02:57:13 +0300 Subject: [PATCH 2/3] doc: comment out ellipses in https.md --- doc/api/https.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/https.md b/doc/api/https.md index 4b23e9abc548e9..2e5f9d36603148 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -202,7 +202,7 @@ const options = { options.agent = new https.Agent(options); const req = https.request(options, (res) => { - ... + // ... }); ``` @@ -222,7 +222,7 @@ const options = { }; const req = https.request(options, (res) => { - ... + // ... }); ``` From 30a148ab455d08519bcf6959d91179618fc93899 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 3 Apr 2017 02:58:41 +0300 Subject: [PATCH 3/3] doc: update code example in https.md Provide relevant test file path, add missing option. --- doc/api/https.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/https.md b/doc/api/https.md index 2e5f9d36603148..59e9fe663c1fb9 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -70,7 +70,8 @@ const https = require('https'); const fs = require('fs'); const options = { - pfx: fs.readFileSync('server.pfx') + pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), + passphrase: 'sample' }; https.createServer(options, (req, res) => {