From 9fd1b6a54c77f78df1031a620fe3fb3887eda56d Mon Sep 17 00:00:00 2001 From: Horus3 Date: Thu, 19 Feb 2015 16:55:23 +0100 Subject: Add health check. --- app/utilities.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/utilities.go') diff --git a/app/utilities.go b/app/utilities.go index bc6c0ca..75967b1 100644 --- a/app/utilities.go +++ b/app/utilities.go @@ -14,19 +14,19 @@ import ( ) // Returns headers as map and the content of a webpage as string -func HttpGet(url string) (http.Header, string, error) { - response, err := http.Get(url) +func HttpGet(url string) (*http.Response, string, error) { + r, err := http.Get(url) if err != nil { - return nil, "Get request failed.", err + return r, "Get request failed.", err } - defer response.Body.Close() - contents, err := ioutil.ReadAll(response.Body) + defer r.Body.Close() + contents, err := ioutil.ReadAll(r.Body) if err != nil { - return nil, "Reading body failed.", err + return r, "Reading body failed.", err } - return response.Header, string(contents), nil + return r, string(contents), nil } // Hashs and returns a string (md5) -- cgit v1.2.3