Index: trac/web/api.py
===================================================================
--- trac/web/api.py	(revision 3556)
+++ trac/web/api.py	(working copy)
@@ -27,6 +27,7 @@
 from trac.util import get_last_traceback
 from trac.util.datefmt import http_date
 from trac.web.href import Href
+from trac.mimeview.api import get_mimetype
 
 HTTP_STATUS = dict([(code, reason.title()) for code, (reason, description)
                     in BaseHTTPRequestHandler.responses.items()])
@@ -388,8 +389,7 @@
             raise RequestDone
 
         if not mimetype:
-            mimetype = mimetypes.guess_type(path)[0] or \
-                       'application/octet-stream'
+            mimetype = get_mimetype(path) or 'application/octet-stream'
 
         self.send_response(200)
         self.send_header('Content-Type', mimetype)

