Debug Captcha: Print mismatches

Signed-off-by: hrj <harshad.rj@gmail.com>
This commit is contained in:
hrj 2021-04-14 10:01:30 +05:30
parent 8fd294f0cf
commit 660447798f

View File

@ -33,7 +33,11 @@ class DebugCaptcha extends ChallengeProvider {
} }
def checkAnswer(secret: String, answer: String): Boolean = { def checkAnswer(secret: String, answer: String): Boolean = {
answer.toLowerCase().equals(secret) val matches = answer.toLowerCase().replaceAll(" ", "").equals(secret)
if (!matches) {
println(s"Didn't match, answer: '$answer' to secret '$secret'")
}
matches
} }
private def simpleText(text: String): Array[Byte] = { private def simpleText(text: String): Array[Byte] = {