lib: fix default difficulty (#96)

Before this did not respect the difficulty flag and instead used
difficulty 4. This has been fixed.

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2025-03-23 18:46:01 -04:00 committed by GitHub
parent f462209b02
commit 725e11d3a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 84 additions and 2 deletions

View file

@ -498,8 +498,8 @@ func (s *Server) check(r *http.Request) (CheckResult, *policy.Bot, error) {
return cr("default/allow", config.RuleAllow), &policy.Bot{
Challenge: &config.ChallengeRules{
Difficulty: anubis.DefaultDifficulty,
ReportAs: anubis.DefaultDifficulty,
Difficulty: s.policy.DefaultDifficulty,
ReportAs: s.policy.DefaultDifficulty,
Algorithm: config.AlgorithmFast,
},
}, nil