feat: add enable and disable keep alive

This commit is contained in:
Jonas Kaninda
2024-10-29 14:36:57 +01:00
parent f30ddac7a1
commit 97c7e0940b
4 changed files with 5 additions and 2 deletions

View File

@@ -57,6 +57,8 @@ func (intercept InterceptErrors) ErrorInterceptor(next http.Handler) http.Handle
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
rec := newResponseRecorder(w)
next.ServeHTTP(rec, r)
//Set Server name
w.Header().Set("Server", "Goma")
if canIntercept(rec.statusCode, intercept.Errors) {
logger.Debug("Backend error intercepted")
logger.Debug("An error occurred in the backend, %d", rec.statusCode)