close stream body after checking that it's reachable
This commit is contained in:
parent
a66f2ae368
commit
24591be57a
1 changed files with 3 additions and 1 deletions
|
@ -21,13 +21,15 @@ func withTitleAndStreamsAndSentry(next http.Handler, cfg Config, sentry *Sentry)
|
||||||
return http.HandlerFunc(handlerFunc)
|
return http.HandlerFunc(handlerFunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Sentry struct {}
|
type Sentry struct {
|
||||||
|
}
|
||||||
|
|
||||||
func (self *Sentry) GetStatus(url string) int {
|
func (self *Sentry) GetStatus(url string) int {
|
||||||
resp, err := http.Get(url)
|
resp, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 500
|
return 500
|
||||||
} else {
|
} else {
|
||||||
|
resp.Body.Close()
|
||||||
return resp.StatusCode
|
return resp.StatusCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue