diff options
author | Kevin Keuning <kkeuning@gmail.com> | 2017-03-05 22:11:42 -0600 |
---|---|---|
committer | Kevin Keuning <kkeuning@gmail.com> | 2017-03-05 22:11:42 -0600 |
commit | 92a96fe470b39ae5c16f66fce8023f04ad3a37ae (patch) | |
tree | fd9a03089b1a6ba1a45bcc733858851a394fa718 /system/api | |
parent | 266b7834c586f3c6be20d6772b36347d1f2a6b35 (diff) |
consolidate UpdateContent into SetContent
Diffstat (limited to 'system/api')
-rw-r--r-- | system/api/update.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/api/update.go b/system/api/update.go index 00933fb..507d3af 100644 --- a/system/api/update.go +++ b/system/api/update.go @@ -52,8 +52,8 @@ func updateContentHandler(res http.ResponseWriter, req *http.Request) { } id := req.URL.Query().Get("id") - if id == "" { - log.Println("[Update] attempt to submit update with missing id from:", req.RemoteAddr) + if !db.IsValidID(id) { + log.Println("[Update] attempt to submit update with missing or invalid id from:", req.RemoteAddr) res.WriteHeader(http.StatusBadRequest) return } @@ -160,7 +160,7 @@ func updateContentHandler(res http.ResponseWriter, req *http.Request) { // set specifier for db bucket in case content is/isn't Trustable var spec string - _, err = db.UpdateContent(t+spec+":"+id, req.PostForm) + _, err = db.SetContent(t+spec+":"+id, req.PostForm) if err != nil { log.Println("[Update] error calling UpdateContent:", err) res.WriteHeader(http.StatusInternalServerError) |