mercurial/hgweb/common.py
changeset 18352 e33b9b92a200
parent 17456 59a168019255
child 18645 76ff3a715cf2
--- a/mercurial/hgweb/common.py	Tue Jan 15 01:05:12 2013 +0100
+++ b/mercurial/hgweb/common.py	Tue Jan 15 01:07:03 2013 +0100
@@ -140,11 +140,11 @@
     try:
         os.stat(path)
         ct = mimetypes.guess_type(path)[0] or "text/plain"
-        req.respond(HTTP_OK, ct, length = os.path.getsize(path))
         fp = open(path, 'rb')
         data = fp.read()
         fp.close()
-        return data
+        req.respond(HTTP_OK, ct, body=data)
+        return ""
     except TypeError:
         raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename')
     except OSError, err: