Commit 27219c01 authored by Nick Thomas's avatar Nick Thomas

Merge branch '219-fix-reverseproxy-panics' into 'master'

Don't log http.ErrAbortHandler panics in sentry

Closes #219

See merge request gitlab-org/gitlab-workhorse!392
parents fd81eeb2 14f5db64
......@@ -47,5 +47,16 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
helper.AllowResponseBuffering(w)
}
// If the ultimate client disconnects when the response isn't fully written
// to them yet, httputil.ReverseProxy panics with a net/http.ErrAbortHandler
// error. We can catch and discard this to keep the error log clean
defer func() {
if err := recover(); err != nil {
if err != http.ErrAbortHandler {
panic(err)
}
}
}()
p.reverseProxy.ServeHTTP(w, &req)
}
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