From 9942cda125fa516cb610ec45b3b1e97557cda5e2 Mon Sep 17 00:00:00 2001 From: mpl Date: Sun, 9 Jun 2013 19:25:00 +0200 Subject: [PATCH] server status: bugfixes, and rid of version as a field. Also smaller font on the index page Change-Id: I5918dedfadf551a8a982d74670fefc4174555c72 --- pkg/server/status.go | 11 ++++------- server/camlistored/newui/index.css | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/server/status.go b/pkg/server/status.go index 5fa8b8af3..835c3f6a3 100644 --- a/pkg/server/status.go +++ b/pkg/server/status.go @@ -27,7 +27,6 @@ import ( // StatusHandler publishes server status information. type StatusHandler struct { - Version string } func init() { @@ -35,16 +34,14 @@ func init() { } func newStatusFromConfig(ld blobserver.Loader, conf jsonconfig.Obj) (h http.Handler, err error) { - sh := &StatusHandler{ - Version: buildinfo.Version(), - } - return sh, nil + return &StatusHandler{}, nil } func (sh *StatusHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { suffix := req.Header.Get("X-PrefixHandler-PathSuffix") if req.Method != "GET" { - http.Error(rw, "Illegal URL.", 404) + http.Error(rw, "Illegal URL.", http.StatusMethodNotAllowed) + return } if suffix == "status.json" { sh.serveStatus(rw, req) @@ -59,7 +56,7 @@ type statusResponse struct { func (sh *StatusHandler) serveStatus(rw http.ResponseWriter, req *http.Request) { res := &statusResponse{ - Version: sh.Version, + Version: buildinfo.Version(), } httputil.ReturnJSON(rw, res) diff --git a/server/camlistored/newui/index.css b/server/camlistored/newui/index.css index f90664dad..1c7a88e56 100644 --- a/server/camlistored/newui/index.css +++ b/server/camlistored/newui/index.css @@ -9,4 +9,5 @@ .cam-index-serverinfo { display: inline; float: right; + font-size: small; }