summaryrefslogtreecommitdiff
path: root/src/hub
diff options
context:
space:
mode:
authorMarkus Grüneis <gimpf@gimpf.org>2014-10-24 14:04:44 +0200
committerMarkus Grüneis <gimpf@gimpf.org>2014-10-24 14:04:44 +0200
commit3eb20b88a579c8a66143bdfaec6f2823d6efbf51 (patch)
tree967f6b02da9b888a75dfc603834f47b91ffd2164 /src/hub
parenthub: Fix DataUpdate queries in store. (diff)
hub: Do not return plain arrays in web.
Diffstat (limited to 'src/hub')
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5srvWeb.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5srvWeb.go b/src/hub/src/spreadspace.org/sfive/s5srvWeb.go
index fd9876b..f205fe7 100644
--- a/src/hub/src/spreadspace.org/sfive/s5srvWeb.go
+++ b/src/hub/src/spreadspace.org/sfive/s5srvWeb.go
@@ -24,7 +24,7 @@ func (self StatsSinkServer) getTagList(c web.C, w http.ResponseWriter, r *http.R
http.Error(w, fmt.Sprintf("failed to retrieve %s: %v", resourceName, err), http.StatusInternalServerError)
return
}
- jsonString, err := json.Marshal(values)
+ jsonString, err := json.Marshal(DataContainer{values})
if err != nil {
http.Error(w, fmt.Sprintf("failed to marshal %s: %v", resourceName, err), http.StatusInternalServerError)
return
@@ -39,7 +39,7 @@ func (self StatsSinkServer) getSourcesList(c web.C, w http.ResponseWriter, r *ht
http.Error(w, fmt.Sprintf("failed to retrieve %s: %v", resourceName, err), http.StatusInternalServerError)
return
}
- jsonString, err := json.Marshal(values)
+ jsonString, err := json.Marshal(DataContainer{values})
if err != nil {
http.Error(w, fmt.Sprintf("failed to marshal %s: %v", resourceName, err), http.StatusInternalServerError)
return
@@ -115,7 +115,7 @@ func (self StatsSinkServer) getUpdateList(c web.C, w http.ResponseWriter, r *htt
http.Error(w, fmt.Sprintf("failed to retrieve %s: %v", resourceName, err), http.StatusInternalServerError)
return
}
- jsonString, err := json.Marshal(values)
+ jsonString, err := json.Marshal(DataContainer{values})
if err != nil {
http.Error(w, fmt.Sprintf("failed to marshal %s: %v", resourceName, err), http.StatusInternalServerError)
return
@@ -173,7 +173,9 @@ func (self StatsSinkServer) getLastUpdateIdForUuid(c web.C, w http.ResponseWrite
http.Error(w, fmt.Sprintf("failed to retrieve %s: %v", resourceName, err), http.StatusInternalServerError)
return
}
- fmt.Fprintf(w, "%s", value)
+ if value != nil {
+ fmt.Fprintf(w, "%s", value)
+ }
}
func (self StatsSinkServer) getStats(c web.C, w http.ResponseWriter, r *http.Request) {