Commit Diff


commit - 378f93299f95281309177a1068493222010cafb3
commit + d8322e0976a01ded7cd6a255f958f28f4cc597ca
blob - 8de977b6fb8791fa480c8443e0ede31d6c9cb938
blob + f341cc88b1c9c39cf914dd193ac8f1a671df85ff
--- 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