From df1e29b4b6a08076e259bd3548353dce8999f4b2 Mon Sep 17 00:00:00 2001 From: sandyx Date: Sun, 24 Nov 2024 11:18:00 -0600 Subject: [PATCH] queryescape --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 57f0a13..d69dcd4 100644 --- a/main.go +++ b/main.go @@ -108,7 +108,7 @@ func main() { log.Println(err) } else { fmt.Println("Created thumbnail for: " + new) - http.HandleFunc("/" + newImg, func(w http.ResponseWriter, r *http.Request) { + http.HandleFunc("/" + url.QueryEscape(newImg), func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "img/png") file, err := os.Open(*directory +"/"+ newImg)