From a1e23dba55c8461d807b82d3873d04f324023de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Tue, 20 Aug 2024 16:13:30 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E4=BB=A3=E7=90=86github.com?= =?UTF-8?q?=E7=9A=84raw=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8sni=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/config/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/config/index.js b/packages/core/src/config/index.js index 366a42d..e7617c1 100644 --- a/packages/core/src/config/index.js +++ b/packages/core/src/config/index.js @@ -88,12 +88,14 @@ module.exports = { '^((/[^/]+){2,})/raw((/[^/]+)+\\.(jpg|jpeg|png|gif))(\\?.*)?$': { // eslint-disable-next-line no-template-curly-in-string proxy: 'https://raw.githubusercontent.com${m[1]}${m[3]}', + sni: 'baidu.com', cacheDays: 7, desc: '仓库内图片,重定向改为代理,并缓存7天。' }, '^((/[^/]+){2,})/raw((/[^/]+)+\\.js)(\\?.*)?$': { // eslint-disable-next-line no-template-curly-in-string proxy: 'https://raw.githubusercontent.com${m[1]}${m[3]}', + sni: 'baidu.com', responseReplace: { headers: { 'content-type': 'application/javascript; charset=utf-8' } }, desc: '仓库内脚本,重定向改为代理,并设置响应头Content-Type。作用:方便script拦截器直接使用,避免引起跨域问题和脚本内容限制问题。' }