Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5694

file mis-identifies mime type of html file

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • rhel-7.9.z
    • rhel-7.9.z
    • file
    • None
    • Important
    • sst_cs_plumbers
    • ssg_core_services
    • 8
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:
      file returns "text/x-c+" for an HTML file that contains a C+ code example.

      Version-Release number of selected component (if applicable):
      file-5.11

      How reproducible:
      Every time

      Steps to Reproduce:
      1. file --mime-type <file>.html

      Actual results:
      <file>.html: text/x-c++

      Expected results:
      <file>.html: text/html

      Additional info:
      Invoking xdg-open on an unrecognized windowing system invokes xdg-mime which, in turn, invokes this file command. The result is that xdg-open opens the file in a text editor instead of in a web browser.

      This flow works on most of my .html files, but fails on the attached html files.

      I found that disrupting the keywords in the code sample included in the file - e.g., inserting a space in the middle of the first instances of "template", "class", "private", and "public" in the attached file, caused file to return the desired mime type.

            vmihalko Vincent Mihalkovic
            jira-bugzilla-migration RH Bugzilla Integration
            Vincent Mihalkovic Vincent Mihalkovic
            qe-baseos-daemons qe-baseos-daemons
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: