修复启用代理时,https请求可能被挂起或被转为http的问题

This commit is contained in:
lyswhut
2022-04-07 14:41:09 +08:00
parent 2e5adeb50c
commit f65213f8aa
5 changed files with 517 additions and 2342 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import { debugRequest } from './env'
import { requestMsg } from './message'
import { bHh } from './music/options'
import { deflateRaw } from 'zlib'
import { getProxyInfo } from './index'
import { getRequestAgent } from './index'
// import fs from 'fs'
const request = (url, options, callback) => {
@@ -277,7 +277,7 @@ const fetchData = async(url, method, {
method,
headers: Object.assign({}, defaultHeaders, headers),
timeout,
proxy: getProxyInfo(),
agent: getRequestAgent(url),
json: format === 'json',
}, (err, resp, body) => {
if (err) return callback(err, null)