|
|
|
@ -59,7 +59,12 @@ const configApi = {
|
|
|
|
|
// eslint-disable-next-line handle-callback-err
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
log.info('开始下载远程配置:', remoteConfigUrl) |
|
|
|
|
request(remoteConfigUrl, (error, response, body) => { |
|
|
|
|
|
|
|
|
|
const headers = {} |
|
|
|
|
if (remoteConfigUrl.startsWith('https://raw.githubusercontent.com/')) { |
|
|
|
|
headers['Server-Name'] = 'baidu.com' |
|
|
|
|
} |
|
|
|
|
request(remoteConfigUrl, headers, (error, response, body) => { |
|
|
|
|
if (error) { |
|
|
|
|
log.error('下载远程配置失败, error:', error, ', response:', response, ', body:', body) |
|
|
|
|
reject(error) |
|
|
|
|