Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-3822

mime type mapping for file names rather than suffixes removes first character of candidate file name before matching with key filename

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 2.7.7
    • 2.7.6
    • None
    • None

    Description

      the line "foo/bar name" in raw-mime.types maps the foo/bar mime type to files named *.name and files named <any single character>name, e.g. 1name, 2name, xname etc.

      See CustomFileNameMap where idx is set to zero when it should be left at -1.

      public String getContentTypeFor(String fileName) {
              int idx = fileName.lastIndexOf('.');
              if (idx == -1) {
                  idx = 0;
              }
              if (fileName.length() == idx) {
                  return null;
              }
              String ext = fileName.substring(idx + 1); //BUG: when idx is zero we strip one character from the name
              return mMapping.get(ext);
          }
      

      Attachments

        Activity

          People

            tom@atlassian.com Tom Davies
            tom@atlassian.com Tom Davies
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: