changeset 2095:0bf2a9e5eff1

Don't send "Content-Type: none" mimetypes.guess_type will return (None, None) when it can't detect the filetype.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Wed, 19 Apr 2006 11:41:22 -0700
parents c067ee483d2e
children f5ebe964c6be
files mercurial/hgweb.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Wed Apr 19 11:39:34 2006 -0700
+++ b/mercurial/hgweb.py	Wed Apr 19 11:41:22 2006 -0700
@@ -419,7 +419,8 @@
         mt = mimetypes.guess_type(f)[0]
         rawtext = text
         if util.binary(text):
-            text = "(binary:%s)" % mt
+            text = "(binary:%s)" % (mt or 'data')
+        mt = mt or 'text/plain'
 
         def lines():
             for l, t in enumerate(text.splitlines(1)):