Skip to content

Commit 44f6c00

Browse files
author
Brian Akins
committed
In my hurry to write this, I neglected to commit this...
1 parent 114df9b commit 44f6c00

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

collector.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,17 @@ func getDataFastcgi(u *url.URL) ([]byte, error) {
8686
return nil, errors.Wrap(err, "fastcgi dial failed")
8787
}
8888

89+
defer fcgi.Close()
90+
8991
resp, err := fcgi.Get(env)
9092
if err != nil {
9193
return nil, errors.Wrap(err, "fastcgi get failed")
9294
}
9395

9496
defer resp.Body.Close()
9597

96-
if resp.StatusCode != 200 {
97-
return nil, errors.Errorf("unexpected HTTP status: %d", resp.StatusCode)
98+
if resp.StatusCode != 200 && resp.StatusCode != 0 {
99+
return nil, errors.Errorf("unexpected status: %d", resp.StatusCode)
98100
}
99101

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

0 commit comments

Comments
 (0)