Mercurial > hg-stable
changeset 1792:a161c61ba8ed
Cleanup of tabs and coding when sending content type.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 22 Feb 2006 08:32:51 +0100 |
parents | 1ed9e97d9d6d |
children | 83c6d8355909 |
files | mercurial/hgweb.py |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb.py Wed Feb 22 08:11:52 2006 +0100 +++ b/mercurial/hgweb.py Wed Feb 22 08:32:51 2006 +0100 @@ -1006,11 +1006,8 @@ 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"))