diff options
author | zhangyongsheng <zhangyongsheng@youzan.com> | 2021-01-06 16:10:28 +0800 |
---|---|---|
committer | zhangyongsheng <zhangyongsheng@youzan.com> | 2021-01-17 17:06:22 +0800 |
commit | 7efada695f9cb7515a78565213f25d8077c206ff (patch) | |
tree | 334dc1f864b5d62582d11aeb30375ecb2ce0ede4 /lib/https.js | |
parent | f658bd1e8f7cd0a328c10c8d2a4eea6cf113122b (diff) | |
download | node-new-7efada695f9cb7515a78565213f25d8077c206ff.tar.gz |
url: expose urlToHttpOptions utility
PR-URL: https://github.com/nodejs/node/pull/35960
Fixes: https://github.com/nodejs/node/issues/34349
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/https.js b/lib/https.js index a7fcf06a95..79ac6c6bd5 100644 --- a/lib/https.js +++ b/lib/https.js @@ -48,7 +48,7 @@ const { ClientRequest } = require('_http_client'); let debug = require('internal/util/debuglog').debuglog('https', (fn) => { debug = fn; }); -const { URL, urlToOptions, searchParamsSymbol } = require('internal/url'); +const { URL, urlToHttpOptions, searchParamsSymbol } = require('internal/url'); const { IncomingMessage, ServerResponse } = require('http'); const { kIncomingMessage } = require('_http_common'); @@ -303,7 +303,7 @@ function request(...args) { if (typeof args[0] === 'string') { const urlStr = ArrayPrototypeShift(args); try { - options = urlToOptions(new URL(urlStr)); + options = urlToHttpOptions(new URL(urlStr)); } catch (err) { options = url.parse(urlStr); if (!options.hostname) { @@ -320,7 +320,7 @@ function request(...args) { } else if (args[0] && args[0][searchParamsSymbol] && args[0][searchParamsSymbol][searchParamsSymbol]) { // url.URL instance - options = urlToOptions(ArrayPrototypeShift(args)); + options = urlToHttpOptions(ArrayPrototypeShift(args)); } if (args[0] && typeof args[0] !== 'function') { |