Sub-Store 更新

后端 2.20.5

- 若设置 $options._res.status, 拉取文件时将设置自定义响应状态码

举例: 请求来自分享且 ua 不符合时, 返回自定义状态码和响应内容

  const { headers, url, path } = $options?._req || {}
  const ua = headers?.['user-agent'] || headers?.['User-Agent']

  if (/^\/share\//.test(url) && !/surge/i.test(ua)) {
    $options._res = {
      status: 418
    }
    $content = `I'm a teapot`
  }


Sub-Store 合集 频道资源合集 恰饭推荐 群组

#SubStore #更新记录 #changlog #updates #脚本 #文件 #分享 #共享 #状态码 #自定义 #响应 #请求