From 954a55adbeea8d2d0808ffca70cf3eb763c37ff7 Mon Sep 17 00:00:00 2001 From: Benny~ Date: Mon, 2 Mar 2020 21:38:55 +0800 Subject: [PATCH] add backward compatibility to exhaust path --- webp-server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webp-server.go b/webp-server.go index 75030f0..67f9629 100644 --- a/webp-server.go +++ b/webp-server.go @@ -278,7 +278,12 @@ func main() { confImgPath := path.Clean(config.ImgPath) QUALITY := config.QUALITY AllowedTypes := config.AllowedTypes - ExhaustPath := config.ExhaustPath + var ExhaustPath string + if len(config.ExhaustPath) == 0 { + ExhaustPath = "./exhaust" + } else { + ExhaustPath = config.ExhaustPath + } if prefetch { prefetchImages(confImgPath, ExhaustPath, QUALITY)