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
commit 1f4cb7077a
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -1188,8 +1188,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,
))
}