Browse Source

bad host handler: return a generic error message

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino 9 months ago
parent
commit
11055d49a3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      internal/httpd/server.go

+ 2 - 1
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,
 	))
 }