outposts: handle/ignore http Abort handler

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-12-20 19:42:45 +01:00
parent 82acba26af
commit 68637cf7cf
3 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import (
"github.com/getsentry/sentry-go"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
"goauthentik.io/internal/outpost/ak"
"goauthentik.io/internal/outpost/proxyv2/metrics"
"goauthentik.io/internal/outpost/proxyv2/templates"
@ -45,6 +46,13 @@ func (a *Application) configureProxy() error {
}
before := time.Now()
rp.ServeHTTP(rw, r)
defer func() {
err := recover()
if err == nil || err == http.ErrAbortHandler {
return
}
log.WithError(err.(error)).Error("recover in reverse proxy")
}()
after := time.Since(before)
user := ""