From 660447798f30b24322b1fb8088d10da405e32ab9 Mon Sep 17 00:00:00 2001 From: hrj Date: Wed, 14 Apr 2021 10:01:30 +0530 Subject: [PATCH] Debug Captcha: Print mismatches Signed-off-by: hrj --- src/main/scala/lc/captchas/DebugCaptcha.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/scala/lc/captchas/DebugCaptcha.scala b/src/main/scala/lc/captchas/DebugCaptcha.scala index 084f1e1..787b6cf 100644 --- a/src/main/scala/lc/captchas/DebugCaptcha.scala +++ b/src/main/scala/lc/captchas/DebugCaptcha.scala @@ -33,7 +33,11 @@ class DebugCaptcha extends ChallengeProvider { } 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] = {