DSpace's SpiderDetectorServiceImplTest.testCaseInsensitiveMatching test incorrectly uses "FirefOx" as a test string to see whether case-insensitive matching of spider user agents will detect this seemingly valid user agent. The problem is that the Firefox browser has never used such a user agent, so it would actually be indicative of a non-human user if a request with that user agent actually came in. Indeed, the COUNTER-Robots list of non-human user agents has the following pattern:
In the case-insensitive test the "FirefOx" string matches and the test fails. A better test string would be a lower case version of an actual Firefox user agent, for example:
mozilla/5.0 (x11; linux x86_64; rv:91.0) gecko/20100101 firefox/91.0
Now the test would be correct: if a spider user agent pattern matched this valid Firefox user agent then the pattern should cause the test to fail. This same issue is currently present in DSpace 7 (main) and DSpace 5 as well. |