diff options
| author | Yagiz Nizipli <yagiz@nizipli.com> | 2023-02-27 09:31:18 -0500 |
|---|---|---|
| committer | Node.js GitHub Bot <github-bot@iojs.org> | 2023-03-01 17:03:58 +0000 |
| commit | e3bb66813260440545a1fd4412f588f2ad1f18fe (patch) | |
| tree | 76b82f204d23fb92e576fd746752a9411416cef5 /lib/https.js | |
| parent | a851391d095472d9cd1ff5a05083264542e9494d (diff) | |
| download | node-new-e3bb66813260440545a1fd4412f588f2ad1f18fe.tar.gz | |
url: offload `URLSearchParams` initialization
PR-URL: https://github.com/nodejs/node/pull/46867
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Diffstat (limited to 'lib/https.js')
| -rw-r--r-- | lib/https.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/https.js b/lib/https.js index 12da66e0f4..ad67a2f724 100644 --- a/lib/https.js +++ b/lib/https.js @@ -52,7 +52,7 @@ const { ClientRequest } = require('_http_client'); let debug = require('internal/util/debuglog').debuglog('https', (fn) => { debug = fn; }); -const { URL, urlToHttpOptions, searchParamsSymbol } = require('internal/url'); +const { URL, urlToHttpOptions, isURL } = require('internal/url'); const { validateObject } = require('internal/validators'); function Server(opts, requestListener) { @@ -350,9 +350,7 @@ function request(...args) { if (typeof args[0] === 'string') { const urlStr = ArrayPrototypeShift(args); options = urlToHttpOptions(new URL(urlStr)); - } else if (args[0] && args[0][searchParamsSymbol] && - args[0][searchParamsSymbol][searchParamsSymbol]) { - // url.URL instance + } else if (isURL(args[0])) { options = urlToHttpOptions(ArrayPrototypeShift(args)); } |
