fix request

This commit is contained in:
shamoon 2025-05-09 01:12:41 -07:00
parent da823ad7e8
commit 8f25bf5427
No known key found for this signature in database

View File

@ -123,10 +123,10 @@ export async function httpProxy(url, params = {}) {
? new https.Agent({ ...agentOptions, rejectUnauthorized: false }) ? new https.Agent({ ...agentOptions, rejectUnauthorized: false })
: new http.Agent(agentOptions); : new http.Agent(agentOptions);
} }
const request = httpsRequest(constructedUrl, { const request =
agent, constructedUrl.protocol === "https:"
...params, ? httpsRequest(constructedUrl, { agent, ...params })
}); : httpRequest(constructedUrl, { agent, ...params });
try { try {
const [status, contentType, data, responseHeaders] = await request; const [status, contentType, data, responseHeaders] = await request;