fix return
This commit is contained in:
parent
84ffc79849
commit
af140b4c98
|
@ -128,7 +128,6 @@ func (s Webp) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.H
|
||||||
|
|
||||||
fh,err:=os.Create(cacheFile)
|
fh,err:=os.Create(cacheFile)
|
||||||
fh.Write(buf.Bytes())
|
fh.Write(buf.Bytes())
|
||||||
// w.Write(buf.Bytes())
|
|
||||||
|
|
||||||
buf.WriteTo(fh)
|
buf.WriteTo(fh)
|
||||||
fh.Close()
|
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.Header().Add("webpstatus", "tocache")
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
w.Write(buf.Bytes())
|
||||||
buf.WriteTo(w)
|
buf.WriteTo(w)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue