Skip to content

Commit

Permalink
In my hurry to write this, I neglected to commit this...
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Akins committed Feb 16, 2018
1 parent 114df9b commit 44f6c00
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ func getDataFastcgi(u *url.URL) ([]byte, error) {
return nil, errors.Wrap(err, "fastcgi dial failed")
}

defer fcgi.Close()

resp, err := fcgi.Get(env)
if err != nil {
return nil, errors.Wrap(err, "fastcgi get failed")
}

defer resp.Body.Close()

if resp.StatusCode != 200 {
return nil, errors.Errorf("unexpected HTTP status: %d", resp.StatusCode)
if resp.StatusCode != 200 && resp.StatusCode != 0 {
return nil, errors.Errorf("unexpected status: %d", resp.StatusCode)
}

body, err := ioutil.ReadAll(resp.Body)
Expand Down

0 comments on commit 44f6c00

Please sign in to comment.