Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-2520

Improve mimetype validation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Fedora 5.0.0
    • Component/s: None
    • Labels:
      None

      Description

      In testing with the Hyku repository app on top of Fedora (using a build from the master branch, May 2017), occasional errors occur when files are deposited but fail to complete the process properly. When attempting to retrieve or delete the item from Fedora, a 500 response is returned. The errors in the log are:

      java.lang.IllegalArgumentException: Error parsing media type 'cannot open `/tmp/40e8273e-1ea8-48ec-916c-e78bc06ba1ea20170608-25523-m6g42x' (No such file or directory)'

      followed by:

      Caused by: java.text.ParseException: White space not allowed.

      Requesting fcr:metadata on the item shows the following:

      ebucore:hasMimeType "cannot open `/tmp/40e8273e-1ea8-48ec-916c-e78bc06ba1ea20170608-25523-m6g42x' (No such file or directory)" ;

      The mimetype set here is clearly invalid. While it seems likely that the primary issue is due to the Hyku app supplying an invalid mimetype, there should be better data validation in Fedora to ensure that a mimetype which cannot be parsed is not allowed into the repository.

      Alternatively, if it is desirable to allow invalid data to be stored, then the API should fail gracefully when that data is requested and allow the item or the metadata itself to be removed or updated without error.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bseeger Bethany Seeger
                Reporter:
                bbranan Bill Branan
                Reviewer:
                Jared Whiklo
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: