From bbac6a5e2ec871ba1fdd0560ee481ada0fa4c74f Mon Sep 17 00:00:00 2001 From: Jonatan Rek Date: Tue, 21 Jan 2025 16:27:23 +0100 Subject: [PATCH] Fixes --- app.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 207348a..a9d27c1 100644 --- a/app.py +++ b/app.py @@ -22,6 +22,15 @@ class ProxyHandler(http.server.BaseHTTPRequestHandler): def log_message(self, format, *args): pass + def finish(self,*args,**kw): + try: + if not self.wfile.closed: + self.wfile.flush() + self.wfile.close() + except socket.error: + pass + self.rfile.close() + def do_GET(self): self.handle_request('GET') @@ -113,15 +122,6 @@ class ProxyHandler(http.server.BaseHTTPRequestHandler): self.wfile.flush() - def finish(self,*args,**kw): - try: - if not self.wfile.closed: - self.wfile.flush() - self.wfile.close() - except socket.error: - pass - self.rfile.close() - class ThreadedHTTPServer(ThreadingMixIn, http.server.HTTPServer): """Handle requests in a separate thread."""