about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2020-03-15 22:31:25 +0100
committerEmile <hanemile@protonmail.com>2020-03-15 22:31:25 +0100
commit34a4a6b061276fd3eea4e1ce6b8fa6cc40b7dc72 (patch)
tree648643b6931d52fc3d03f50fdab152c6d2066955
parentb00f0de446c78fd9184babac7544f9a9fab3e5c9 (diff)
removed debug prints
-rw-r--r--src/http/http.go9
1 files 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)
 }