dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit e4aaf59c3b86ad9fbee6477c541679764d3cbdc8
parent d36d8ec489ab949d46a7ab15840bfd4fcd36c6cb
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 18 Jan 2024 16:51:23 -0800

limit log size

Diffstat:
Mpkg/web/handlers/interceptors/spamInterceptor.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/web/handlers/interceptors/spamInterceptor.go b/pkg/web/handlers/interceptors/spamInterceptor.go @@ -163,11 +163,11 @@ func checkSpam(db *database.DkfDB, origMessage, lowerCaseMessage string, authUse retardRatio := float64(repeatedWordsCount) / float64(totalUniqueWords) //fmt.Println(tot, totalUniqueWords, uniqueRatio, repeatedWordsCount, retardRatio, wordsMap) if uniqueRatio < 0.2 { - logrus.Error("failed unique ratio: " + origMessage) + logrus.Error("failed unique ratio: " + utils.TruncStr(origMessage, 75, "…")) return errors.New("failed unique ratio") } if retardRatio > 0.1 { - logrus.Error("failed retard ratio: " + origMessage) + logrus.Error("failed retard ratio: " + utils.TruncStr(origMessage, 75, "…")) return errors.New("failed retard ratio") } }