下载远程配置文件时,再添加请求头 `Pragma: no-cache` 避免缓存

pull/366/head
王良 2024-09-21 22:45:12 +08:00
parent 54d92fd00c
commit d1185e5ff5
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,8 @@ const configApi = {
log.info('开始下载远程配置:', remoteConfigUrl)
const headers = {
'Cache-Control': 'no-cache' // 禁止使用缓存
'Cache-Control': 'no-cache', // 禁止使用缓存
Pragma: 'no-cache' // 禁止使用缓存
}
if (remoteConfigUrl.startsWith('https://raw.githubusercontent.com/')) {
headers['Server-Name'] = 'baidu.com'