From af140b4c98880144a9418088dd095ca9d77ae579 Mon Sep 17 00:00:00 2001 From: shortcut Date: Mon, 25 Jul 2022 15:21:54 -0400 Subject: [PATCH] fix return --- caddywebp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddywebp.go b/caddywebp.go index f7d9a10..c67f247 100644 --- a/caddywebp.go +++ b/caddywebp.go @@ -128,7 +128,6 @@ func (s Webp) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.H fh,err:=os.Create(cacheFile) fh.Write(buf.Bytes()) -// w.Write(buf.Bytes()) buf.WriteTo(fh) fh.Close() @@ -136,6 +135,7 @@ func (s Webp) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.H w.Header().Add("webpstatus", "tocache") w.WriteHeader(http.StatusOK) + w.Write(buf.Bytes()) buf.WriteTo(w) return nil }