sinzmise-cetastories-en 2.0.0-1732437050802 → 2.0.0-1732439769720

Sign up to get free protection for your applications and to get access to all the features.
package/config.yaml CHANGED
@@ -25,37 +25,3 @@ catch_rules:
25
25
  - https://jsd.cdn.storisinz.site/gh
26
26
  - https://code.webcache.cn/gh
27
27
 
28
- - rule: _ #ClientWorker语法糖,匹配当前域,返回一个域名带端口
29
- transform_rules: #转换规则,最上面的优先最高
30
- - search: \#.* #在发送请求时匹配#后内容并移除
31
- searchin: url
32
- replace: ''
33
- - search: \?.* #在发送请求时匹配?后内容并移除,仅限静态请求
34
- replace: ''
35
- - search: boringbay\.com #绕过boringbay
36
- action: skip
37
- - search: tk\.pl\.blog\.sinzmise\.top #绕过twikoo后端
38
- action: skip
39
- - search: _
40
- replace:
41
- - _ #保留原始请求
42
- - en.vercel.blog.sinzmise.top #Vercel托管
43
-
44
- - search: \.html$
45
- header:
46
- Content-Type: text/html;charset=UTF-8 #修复标头
47
-
48
- - search: _
49
- action: fetch
50
- fetch:
51
- status: 200
52
- engine: classic
53
- preflight: false
54
- timeout: 5000
55
-
56
- - search: (^4|^5)
57
- searchin: status
58
- action: return
59
- return:
60
- body: The GateWay is down!This Page is provided by ClientWorker!
61
- status: 503
package/cw.js CHANGED
@@ -1 +1 @@
1
- importScripts("https://jsd.cdn.storisinz.site/npm/clientworker/dist/cw.js");
1
+ importScripts("https://jsd.cdn.storisinz.site/npm/clientworker/dist/cw.js");const CACHE_NAME="CetaHouseEnCache";let cachelist=[];self.addEventListener("install",(async function(e){self.skipWaiting(),e.waitUntil(caches.open(CACHE_NAME).then((function(e){return console.log("Opened cache"),e.addAll(cachelist)})))})),self.addEventListener("fetch",(async e=>{try{e.respondWith(handle(e.request))}catch(t){e.respondWith(handleerr(e.request,t))}}));const handleerr=async(e,t)=>new Response(`<h1>CDN分流器遇到了致命错误</h1>\n <b>${t}</b>`,{headers:{"content-type":"text/html; charset=utf-8"}}),lfetch=async(e,t)=>{let n=new AbortController;const s=async e=>new Response(await e.arrayBuffer(),{status:e.status,headers:e.headers});return Promise.any||(Promise.any=function(e){return new Promise(((t,n)=>{let s=(e=Array.isArray(e)?e:[]).length,r=[];if(0===s)return n(new AggregateError("All promises were rejected"));e.forEach((e=>{e.then((e=>{t(e)}),(e=>{s--,r.push(e),0===s&&n(new AggregateError(r))}))}))}))}),Promise.any(e.map((e=>new Promise(((t,r)=>{fetch(e,{signal:n.signal}).then(s).then((e=>{200==e.status?(n.abort(),t(e)):r(e)}))})))))};self.addEventListener("fetch",(async e=>{e.respondWith(handle(e.request))}));const fullpath=e=>((e=e.split("?")[0].split("#")[0]).match(/\/$/)&&(e+="index"),e.match(/\.[a-zA-Z]+$/)||(e+=".html"),e),handle=async e=>{const t=e.url,n=new URL(t),s=n.pathname;return"en.blog.sinzmise.top"===n.hostname?lfetch(["https://en.vercel.blog.sinzmise.top"+fullpath(s)]):fetch(e)};