|
|
|
@ -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
|
|
|
|
|