From 8f25bf54277c5c700b5a8b83d659571667b18970 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 9 May 2025 01:12:41 -0700 Subject: [PATCH] fix request --- src/utils/proxy/http.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/proxy/http.js b/src/utils/proxy/http.js index e880cfaaa..d721ffd85 100644 --- a/src/utils/proxy/http.js +++ b/src/utils/proxy/http.js @@ -123,10 +123,10 @@ export async function httpProxy(url, params = {}) { ? new https.Agent({ ...agentOptions, rejectUnauthorized: false }) : new http.Agent(agentOptions); } - const request = httpsRequest(constructedUrl, { - agent, - ...params, - }); + const request = + constructedUrl.protocol === "https:" + ? httpsRequest(constructedUrl, { agent, ...params }) + : httpRequest(constructedUrl, { agent, ...params }); try { const [status, contentType, data, responseHeaders] = await request;