summaryrefslogtreecommitdiff
path: root/system/api
diff options
context:
space:
mode:
authorKevin Keuning <kkeuning@gmail.com>2017-03-05 22:11:42 -0600
committerKevin Keuning <kkeuning@gmail.com>2017-03-05 22:11:42 -0600
commit92a96fe470b39ae5c16f66fce8023f04ad3a37ae (patch)
treefd9a03089b1a6ba1a45bcc733858851a394fa718 /system/api
parent266b7834c586f3c6be20d6772b36347d1f2a6b35 (diff)
consolidate UpdateContent into SetContent
Diffstat (limited to 'system/api')
-rw-r--r--system/api/update.go6
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)