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;