小调整。

pull/341/head
王良 2024-09-05 14:19:43 +08:00
parent 2125cea074
commit edb4c1999f
2 changed files with 2 additions and 14 deletions

View File

@ -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)

View File

@ -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)