修复若配置了http_proxy环境变量时,会意外使用此代理配置的问题
This commit is contained in:
@@ -52,6 +52,10 @@ export default () => {
|
||||
|
||||
|
||||
getEnvParams().then(envParams => {
|
||||
// 移除代理相关的环境变量设置,防止请求库自动应用它们
|
||||
for (const key of Object.keys(process.env)) {
|
||||
if (/^(?:http_proxy|https_proxy|NO_PROXY)$/i.test(key)) delete process.env[key]
|
||||
}
|
||||
const envProxy = envParams.cmdParams['proxy-server']
|
||||
if (envProxy && typeof envProxy == 'string') {
|
||||
const [host, port = ''] = envProxy.split(':')
|
||||
|
||||
@@ -18,8 +18,7 @@ export default () => {
|
||||
|
||||
return () => {
|
||||
const waitUpdateLists = Object.entries(getListUpdateInfo())
|
||||
.filter(([id, info]) => info.isAutoUpdate)
|
||||
.map(([id]) => userLists.find(l => l.id === id))
|
||||
.map(([id, info]) => info.isAutoUpdate && userLists.find(l => l.id === id))
|
||||
.filter(_ => _)
|
||||
for (let i = 2; i > 0; i--) {
|
||||
handleSyncSourceList(waitUpdateLists)
|
||||
|
||||
Reference in New Issue
Block a user