fix return
This commit is contained in:
parent
af140b4c98
commit
051acc89c3
10
caddywebp.go
10
caddywebp.go
|
@ -125,18 +125,18 @@ func (s Webp) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.H
|
||||||
return next.ServeHTTP(w, r)
|
return next.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b:=buf.Bytes()
|
||||||
fh,err:=os.Create(cacheFile)
|
fh,err:=os.Create(cacheFile)
|
||||||
fh.Write(buf.Bytes())
|
fh.Write(b)
|
||||||
|
|
||||||
buf.WriteTo(fh)
|
// buf.WriteTo(fh)
|
||||||
fh.Close()
|
fh.Close()
|
||||||
w.Header().Set("content-Type", "image/webp")
|
w.Header().Set("content-Type", "image/webp")
|
||||||
w.Header().Add("webpstatus", "tocache")
|
w.Header().Add("webpstatus", "tocache")
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write(buf.Bytes())
|
w.Write(b)
|
||||||
buf.WriteTo(w)
|
// buf.WriteTo(w)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue