From 34a4a6b061276fd3eea4e1ce6b8fa6cc40b7dc72 Mon Sep 17 00:00:00 2001 From: Emile Date: Sun, 15 Mar 2020 22:31:25 +0100 Subject: removed debug prints --- src/http/http.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/http/http.go b/src/http/http.go index 824c7a3..83faa93 100644 --- a/src/http/http.go +++ b/src/http/http.go @@ -46,21 +46,16 @@ func downloadHandler(w http.ResponseWriter, r *http.Request) { file := query["file"][0] - logrus.Info(file) - root := viper.GetString("server.root") logrus.Info(root) strippedFile := strings.Replace(file, root, "", -1) strippedFile = strings.Replace(strippedFile, "..", "", -1) - logrus.Info(strippedFile) - logrus.Infof("stripped: %s", strippedFile) - w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%s", strippedFile)) w.Header().Set("Content-Type", r.Header.Get("Content-Type")) - actualFile := fmt.Sprintf("%s/%s", root, strippedFile) - logrus.Infof("actual: %s", actualFile) + actualFile := fmt.Sprintf("%s%s", root, strippedFile) + logrus.Infof("serving: %s", actualFile) http.ServeFile(w, r, actualFile) } -- cgit 1.4.1