Options to disable validation for load testing purpose

This commit is contained in:
Valentin Carroy 2024-10-29 12:04:27 +01:00
parent d23311f5b0
commit bc243071be
2 changed files with 11 additions and 10 deletions

View File

@ -83,7 +83,7 @@ func (s *Server) submitHandler(w http.ResponseWriter, r *http.Request) {
return
}
if !verified {
if !verified && !s.config.DisableValidation {
slog.Debug("Invalid solution")
http.Error(w, "Invalid solution", http.StatusBadRequest)
return

View File

@ -10,4 +10,5 @@ type Config struct {
Expire string `env:"ALTCHA_EXPIRE" envDefault:"600"`
CheckExpire bool `env:"ALTCHA_CHECK_EXPIRE" envDefault:"1"`
Debug bool `env:"ALTCHA_DEBUG" envDefault:"false"`
DisableValidation bool `env:"ATLCHA_DISABLE_VALIDATION" envDefault:"false"`
}