小调整。
parent
2125cea074
commit
edb4c1999f
|
@ -90,12 +90,7 @@ const configApi = {
|
|||
if (remoteConfigUrl.startsWith('https://raw.githubusercontent.com/')) {
|
||||
headers['Server-Name'] = 'baidu.com'
|
||||
}
|
||||
|
||||
const options = {
|
||||
url: remoteConfigUrl,
|
||||
headers
|
||||
}
|
||||
request(options, (error, response, body) => {
|
||||
request(remoteConfigUrl, { headers }, (error, response, body) => {
|
||||
if (error) {
|
||||
log.error('下载远程配置失败, error:', error, ', response:', response, ', body:', body)
|
||||
reject(error)
|
||||
|
|
|
@ -140,15 +140,8 @@ function updateHandle (app, api, win, beforeQuit, quit, log) {
|
|||
|
||||
// 检查更新
|
||||
const releasesApiUrl = 'https://api.github.com/repos/docmirror/dev-sidecar/releases'
|
||||
const options = {
|
||||
url: releasesApiUrl,
|
||||
headers: {
|
||||
'User-Agent': `DS/${curVersion}`,
|
||||
'Server-Name': 'baidu.com'
|
||||
}
|
||||
}
|
||||
async function checkForUpdatesFromGitHub () {
|
||||
request(options, (error, response, body) => {
|
||||
request(releasesApiUrl, { headers: { 'User-Agent': 'DS/' + curVersion, 'Server-Name': 'baidu.com' } }, (error, response, body) => {
|
||||
try {
|
||||
if (error) {
|
||||
log.error('检查更新失败:', error)
|
||||
|
|
Loading…
Reference in New Issue