更新 proxy/handler.go

This commit is contained in:
XOF
2025-12-15 03:07:25 +08:00
parent 33ab3d5613
commit 18b1007cc9

View File

@@ -267,6 +267,10 @@ func (h *ProxyHandler) sendResponse(w http.ResponseWriter, resp *http.Response,
func (h *ProxyHandler) serveCached(w http.ResponseWriter, entry *cache.CacheEntry) {
for key, value := range entry.Headers {
// 跳过这些头,让 Go 自动处理
if key == "Content-Encoding" || key == "Content-Length" {
continue
}
w.Header().Set(key, value)
}