diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive/s5srvWeb.go | 10 |
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) { |