Commit b455b192 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Make sure we close HTTP auth response bodies

We were seeing a resource leak:

2015/08/07 12:09:17 Get http://localhost:8080/gitlab/omnibus-gitlab.git/info/refs?service=git-upload-pack: dial tcp: lookup localhost: too many open files
2015/08/07 12:09:18 http: Accept error: accept tcp 127.0.0.1:8181: too many open files; retrying in 5ms

My guess is it was about not closing the auth response body.
parent 3257315a
......@@ -125,6 +125,8 @@ func gitHandler(w http.ResponseWriter, r *http.Request) {
fail500(w, err)
return
}
defer authResponse.Body.Close()
if authResponse.StatusCode != 200 {
// The Git request is not allowed by the backend. Maybe the
// client needs to send HTTP Basic credentials. Forward the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment