summaryrefslogtreecommitdiff
path: root/misc/dashboard/builder/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc/dashboard/builder/http.go')
-rw-r--r--misc/dashboard/builder/http.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/dashboard/builder/http.go b/misc/dashboard/builder/http.go
index e50ae5724..b50e84551 100644
--- a/misc/dashboard/builder/http.go
+++ b/misc/dashboard/builder/http.go
@@ -56,8 +56,10 @@ func dash(meth, cmd string, args url.Values, req, resp interface{}) error {
if err != nil {
return err
}
-
defer r.Body.Close()
+ if r.StatusCode != http.StatusOK {
+ return fmt.Errorf("bad http response: %v", r.Status)
+ }
body := new(bytes.Buffer)
if _, err := body.ReadFrom(r.Body); err != nil {
return err