Apache should tap into the shared-mime-info database

Bug #601501 reported by Delan Azabani
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Apache has its own small MIME database, however it is quite limited. Apache would benefit from sending files as the correct MIME type based on the information searched in the shared-mime-info database, which contains many more type definitions, as well as the facility for magic/namespace detection.

affects: ubuntu → apache2 (Ubuntu)
Revision history for this message
Mathias Gug (mathiaz) wrote :

According to the configuration of the mime module the default apache2 configuration is already using /etc/mime.types:

  #
  # TypesConfig points to the file containing the list of mappings from
 # filename extension to MIME-type.
 #
 TypesConfig /etc/mime.types

The mime-support handles /etc/mime.types. So apache2 is already using the system mime type database.

Changed in apache2 (Ubuntu):
status: New → Invalid
importance: Undecided → Wishlist
Revision history for this message
Delan Azabani (azabani) wrote :

I believe you are wrong. /etc/mime.types is not the shared-mime-info database I am talking about. I am aware that Apache uses /etc/mime.types, which only has extension globbing, but no magic or namespace detection. The shared-mime-info database is cascaded in the following three directories (only the first two are necessary for Apache):

/usr/share/mime
/usr/local/share/mime
/home/*/.local/share/mime

Changed in apache2 (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Stefan Fritsch (sf-sfritsch) wrote :

About magic:

Apache's mod_mime_magic does not support all features that are used in /usr/share/mime/magic. Using that file would result in error messages. And from a quick glance at libmagic, it doesn't seem possible to use it in mod_mime_magic either because it is not thread safe. Therefore apache brings its own magic file.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.