SimpleHTTPServer.py from python2.4 (and python2.3, so
this is an old bug that hasn't bothered anyone before
now), uses mimetypes for mime-type detection.
The issue is that it only uses 50% of mimetypes, in two
different ways.
I argue that SimpleHTTPServer should not be copying
mimetypes type-map into its own variable instead of
leveraging the functionality found in
mimetypes.guess_type (which guesses without regard to
case, btw).
If, however, you guys stick with your own
extension_map, this bug is really about calling ``if
not mimetypes.inited: mimetypes.init()'' before doing
any such copying.
This allows mimetypes to find mime.types on the local
host and populate the types_map with lots of meaningful
mime types. If it doesn't find any mime.types, no harm
done.
|