Add unit tests for DetectAuthType function

This commit is contained in:
Ullaakut
2019-05-22 22:08:35 +02:00
committed by Brendan Le Glaunec
parent 260a9645be
commit 862e9f3de9
2 changed files with 124 additions and 21 deletions
-6
View File
@@ -101,13 +101,7 @@ func DetectAuthMethods(c Curler, targets []Stream, timeout time.Duration, log bo
attacks := make(chan Stream)
defer close(attacks)
validate := v.New()
for i := range targets {
err := validate.Struct(targets[i])
if err != nil {
return targets, errors.Wrap(err, "invalid targets")
}
targets[i].AuthenticationType = detectAuthMethod(c, targets[i], timeout, log)
}