diff --git a/save_cache.go b/save_cache.go index 52ddeab..aec5ea1 100644 --- a/save_cache.go +++ b/save_cache.go @@ -124,8 +124,7 @@ func (r *cache) ServeHTTP(w http.ResponseWriter, req *http.Request) { http.Error(w, "server error", http.StatusInternalServerError) return } - buf := [8 * 1024 * 1024]byte{} - _, err = io.CopyBuffer(file, req.Body, buf[:]) + _, err = io.Copy(file, req.Body) if err != nil { log.Printf("io.Copy: %w", err) http.Error(w, "server error", http.StatusInternalServerError) @@ -143,8 +142,7 @@ func (r *cache) ServeHTTP(w http.ResponseWriter, req *http.Request) { http.Error(w, "server error", http.StatusInternalServerError) return } - buf := [8 * 1024 * 1024]byte{} - _, err = io.CopyBuffer(w, file, buf[:]) + _, err = io.Copy(w, file) if err != nil { log.Printf("io.Copy: %w", err) http.Error(w, "server error", http.StatusInternalServerError)