From 11055d49a3e5da18bb006c5f4335f2eef5e7316a Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Mon, 6 Jan 2025 09:25:41 +0100 Subject: [PATCH] bad host handler: return a generic error message Signed-off-by: Nicola Murino --- internal/httpd/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/httpd/server.go b/internal/httpd/server.go index d532d020..f50d7d27 100644 --- a/internal/httpd/server.go +++ b/internal/httpd/server.go @@ -1191,8 +1191,9 @@ func (s *httpdServer) badHostHandler(w http.ResponseWriter, r *http.Request) { break } } + logger.Debug(logSender, "", "the host %q is not allowed", host) 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, )) }