浏览代码

bad host handler: return a generic error message

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino 9 月之前
父节点
当前提交
11055d49a3
共有 1 个文件被更改,包括 2 次插入1 次删除
  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,
 	))
 }