refactor: 优化超时设置并调整缓存处理逻辑

移除冗余的 `requestTimeout` 变量,将 `fetchApiData` 的超时时间调整为 5 秒,并在 `fetchAndServe` 中取消超时限制。同时,增加对 `content-length` 的校验,当响应内容小于 2KB 且与缓存文件大小不一致时,返回 502 错误。
This commit is contained in:
2025-05-24 09:32:28 +08:00
parent 305837ea65
commit f7dbca480b
3 changed files with 20 additions and 9 deletions

File diff suppressed because one or more lines are too long