aboutsummaryrefslogtreecommitdiffstats
path: root/api.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2016-11-15 15:17:45 +0100
committerclsr <clsr@clsr.net>2016-11-15 19:28:43 +0100
commit1e55e61786eaedd59c067f4306fb8427dc92ef52 (patch)
treec24521f8d70d39508b4ed751c60e0f79891bfa48 /api.go
parent1583e219cd6eda19c3e7158950e5be9c87d9a8de (diff)
downloadgomf-1e55e61786eaedd59c067f4306fb8427dc92ef52.tar.gz
gomf-1e55e61786eaedd59c067f4306fb8427dc92ef52.zip
Add logging support
Diffstat (limited to 'api.go')
-rw-r--r--api.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/api.go b/api.go
index 49b8a61..464d110 100644
--- a/api.go
+++ b/api.go
@@ -67,7 +67,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
output := r.FormValue("output")
resp := response{Files: []result{}}
- if r.Method == http.MethodGet && output == "html" {
+ if r.Method == http.MethodGet && (output == "html" || output == "") {
respond(w, output, resp)
return
}
@@ -113,6 +113,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
Hash: hex.EncodeToString(bhash),
Size: size,
}
+ LogUpload(r, res)
resp.Files = append(resp.Files, res)
part.Close()