Uploaded image for project: 'DSpace (LEGACY)'
  1. DSpace (LEGACY)
  2. DS-4588

Incorrect spider detector test

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.3, 7.0
    • Fix Version/s: None
    • Component/s: DSpace API
    • Labels:
    • Attachments:
      0
    • Comments:
      0
    • Documentation Status:
      Not Required

      Description

      dspace-api'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:

      ^firefox$
      

      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 appears to be present in DSpace 7 (main) as well.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              aorth Alan Orth
              Reviewer:
              Bram Luyten (Atmire) Bram Luyten (Atmire)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: