bad host handler: return a generic error message

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-01-06 09:25:41 +01:00
parent b02b79fe6d
commit 11055d49a3

View File

@@ -1191,8 +1191,9 @@ func (s *httpdServer) badHostHandler(w http.ResponseWriter, r *http.Request) {
break break
} }
} }
logger.Debug(logSender, "", "the host %q is not allowed", host)
s.sendForbiddenResponse(w, r, util.NewI18nError( s.sendForbiddenResponse(w, r, util.NewI18nError(
util.NewGenericError(fmt.Sprintf("The host %q is not allowed", host)), util.NewGenericError(http.StatusText(http.StatusForbidden)),
util.I18nErrorConnectionForbidden, util.I18nErrorConnectionForbidden,
)) ))
} }