Fix nil map bug and status.json route. (refs #2561)
authorTim Pierce <twp@curoverse.com>
Fri, 11 Apr 2014 22:01:14 +0000 (18:01 -0400)
committerTim Pierce <twp@curoverse.com>
Fri, 11 Apr 2014 22:01:14 +0000 (18:01 -0400)
services/keep/keep.go

index 1ea8240861ac2a253e834118f133590f4e6a4fa4..03f0b8f77ee308d6e2eaefed6eb62c6ee47c0b12 100644 (file)
@@ -107,7 +107,7 @@ func main() {
        rest.HandleFunc(`/{hash:[0-9a-f]{32}}`, PutBlockHandler).Methods("PUT")
        rest.HandleFunc(`/index`, IndexHandler).Methods("GET", "HEAD")
        rest.HandleFunc(`/index/{prefix:[0-9a-f]{0,32}}`, IndexHandler).Methods("GET", "HEAD")
-       rest.HandleFunc(`/status\.json`, StatusHandler).Methods("GET", "HEAD")
+       rest.HandleFunc(`/status.json`, StatusHandler).Methods("GET", "HEAD")
 
        // Tell the built-in HTTP server to direct all requests to the REST
        // router.
@@ -240,6 +240,7 @@ func StatusHandler(w http.ResponseWriter, req *http.Request) {
                }
        }
 
+       st.Volumes = make(map[string]VolumeStatus)
        for _, vol := range KeepVolumes {
                st.Volumes[vol] = GetVolumeStatus(vol)
        }