Commit Diff
--- yah2g.py +++ yah2g.py @@ -160,7 +160,11 @@ class _RequestHandler(BaseHTTPRequestHandler): self.send_response(HTTPStatus.OK) self.send_header("Content-type", mime) self.end_headers() - self.wfile.write(fp.read()) + while True: + buffer = fp.read(64 * 1024) + if not buffer: + break # EOF + self.wfile.write(buffer) return m = Message() m['content-type'] = mime