optimize: 下载远程配置功能,禁止远端服务器使用缓存。
parent
5eccc80f34
commit
ab0946b14b
|
@ -84,11 +84,13 @@ const configApi = {
|
|||
return new Promise((resolve, reject) => {
|
||||
log.info('开始下载远程配置:', remoteConfigUrl)
|
||||
|
||||
const headers = {}
|
||||
const headers = {
|
||||
'Cache-Control': 'no-cache' // 禁止使用缓存
|
||||
}
|
||||
if (remoteConfigUrl.startsWith('https://raw.githubusercontent.com/')) {
|
||||
headers['Server-Name'] = 'baidu.com'
|
||||
}
|
||||
request(remoteConfigUrl, headers, (error, response, body) => {
|
||||
request(remoteConfigUrl, { headers }, (error, response, body) => {
|
||||
if (error) {
|
||||
log.error('下载远程配置失败, error:', error, ', response:', response, ', body:', body)
|
||||
reject(error)
|
||||
|
|
Loading…
Reference in New Issue