Detect attachment scam regardless of case (jpg vs JPG) by Zabuzard · Pull Request #1319 · Together-Java/TJ-Bot

We recently had a case in PROD where someone posted attachment-based scam that went undetected.

The message looked like this:

scam

The reason was that our code compared file extensions case-sensitive. For example only attachments like 1.jpg are detected as image (and hence contribute to the scam check). Attachments like 1.JPG bypassed it.

Simple fix. Also added a unit test.