From ca5696cf46dc32e148f3fca8bba718e1342b3571 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Thu, 8 Nov 2018 01:45:45 +0800 Subject: [PATCH] Fixed the megacheck issue. --- bridge/api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/api/api.go b/bridge/api/api.go index daffd074..15e73745 100644 --- a/bridge/api/api.go +++ b/bridge/api/api.go @@ -100,11 +100,11 @@ func (b *Api) handleConfigReload(c echo.Context) error { return c.String(http.StatusInternalServerError, "Internal Server Error") } res, err := http.Get(cfgURL) - defer res.Body.Close() if err != nil { b.Log.Error("Failed to fetch remote config file: ", err) return c.String(http.StatusInternalServerError, "Internal Server Error") } + defer res.Body.Close() content, err := ioutil.ReadAll(res.Body) if err != nil { b.Log.Error("Error reading remote config file: ", err)