diff options
author | Emile <hanemile@protonmail.com> | 2020-03-15 22:31:25 +0100 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2020-03-15 22:31:25 +0100 |
commit | 34a4a6b061276fd3eea4e1ce6b8fa6cc40b7dc72 (patch) | |
tree | 648643b6931d52fc3d03f50fdab152c6d2066955 /src/http | |
parent | b00f0de446c78fd9184babac7544f9a9fab3e5c9 (diff) |
removed debug prints
Diffstat (limited to 'src/http')
-rw-r--r-- | src/http/http.go | 9 |
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) } |