Skip to content

Commit

Permalink
bad host handler: return a generic error message
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Jan 6, 2025
1 parent b02b79f commit 11055d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/httpd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
))
}
Expand Down

0 comments on commit 11055d4

Please sign in to comment.