Wed Dec 21 22:24:47 UTC 2005 gaetan.lehmann@jouy.inra.fr
* enhance mime type for binary files
{
hunk ./darcsweb.cgi 23
+import mimetypes
hunk ./darcsweb.cgi 400
- print "Content-type: application/octet-stream"
+ if fname :
+ (mime, enc) = mimetypes.guess_type(fname)
+ else :
+ mime = None
+ if mime :
+ print "Content-type: %s" % mime
+ else :
+ print "Content-type: application/octet-stream"
}