feat: 缓存拦截器,对 `300`、`301`、`302` 的响应也生效

build-arm64
王良 3 weeks ago
parent 8a2b114baf
commit 0840831298

@ -8,7 +8,7 @@ module.exports = {
// 只有GET请求且响应码为 2xx 或 3xx 时才进行缓存
const minStatusCode = interceptOpt.cacheMinStatusCode || 200
const maxStatusCode = interceptOpt.cacheMaxStatusCode || 399
const maxStatusCode = interceptOpt.cacheMaxStatusCode || 303
if (rOptions.method !== 'GET' || proxyRes.statusCode < minStatusCode || proxyRes.statusCode > maxStatusCode) {
// res.setHeader('DS-Cache-Response-Interceptor', `skip: 'method' or 'status' not match`)
return

Loading…
Cancel
Save