diff options
author | James M Snell <jasnell@gmail.com> | 2017-01-05 10:25:46 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-01-09 09:28:11 -0800 |
commit | 0f62ee6963a40930ec02147db40b2a4a270b0e1d (patch) | |
tree | 0f2a72fbabbb86e8e928e2e4e145ef4174d7d5b1 /test/parallel/test-https-client-get-url.js | |
parent | fd115862f413899996130c00a6109cd5448d760e (diff) | |
download | android-node-v8-0f62ee6963a40930ec02147db40b2a4a270b0e1d.tar.gz android-node-v8-0f62ee6963a40930ec02147db40b2a4a270b0e1d.tar.bz2 android-node-v8-0f62ee6963a40930ec02147db40b2a4a270b0e1d.zip |
url: allow use of URL with http.request and https.request
PR-URL: https://github.com/nodejs/node/pull/10638
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-https-client-get-url.js')
-rw-r--r-- | test/parallel/test-https-client-get-url.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js index 4e92b6ae88..6852967848 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -12,6 +12,8 @@ if (!common.hasCrypto) { const https = require('https'); const fs = require('fs'); +const url = require('url'); +const URL = url.URL; var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), @@ -25,8 +27,11 @@ var server = https.createServer(options, common.mustCall(function(req, res) { res.write('hello\n'); res.end(); server.close(); -})); +}, 3)); server.listen(0, function() { - https.get(`https://127.0.0.1:${this.address().port}/foo?bar`); + const u = `https://127.0.0.1:${this.address().port}/foo?bar`; + https.get(u); + https.get(url.parse(u)); + https.get(new URL(u)); }); |