mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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>
This commit is contained in:
committed by
Node.js GitHub Bot
parent
a851391d09
commit
e3bb668132
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user