mercurial/hgweb.py
changeset 1792 a161c61ba8ed
parent 1780 8a1f2eae2832
child 1793 83c6d8355909
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -1006,11 +1006,8 @@ class hgweb(object):
 
                 os.stat(fname)
 
-		ct = mimetypes.guess_type(fname)[0]
-		if ct == None:
-			ct = "text/plain"
-
-                req.write("Content-type: " + ct + "\n\n" + file(fname).read())
+                ct = mimetypes.guess_type(fname)[0] or "text/plain"
+                req.write("Content-type: %s\n\n" % ct, file(fname).read())
             except ValueError:
                 # security breach attempt
                 req.write(self.t("error"))