diff -r 3fbdbeab38cc -r e33b9b92a200 mercurial/hgweb/common.py --- 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: