diff options
| author | Horus3 | 2015-02-19 16:55:23 +0100 |
|---|---|---|
| committer | Horus3 | 2015-02-19 16:55:23 +0100 |
| commit | 9fd1b6a54c77f78df1031a620fe3fb3887eda56d (patch) | |
| tree | a22686f2eac23c7a47e9ccd9aa3962aa80a5bf64 /app/utilities.go | |
| parent | 5da13e75c013688f4fda1e57a5b3968332caa760 (diff) | |
| download | statuspage-9fd1b6a54c77f78df1031a620fe3fb3887eda56d.tar.gz | |
Add health check.
Diffstat (limited to 'app/utilities.go')
| -rw-r--r-- | app/utilities.go | 14 |
1 files changed, 7 insertions, 7 deletions
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) |
