This commit is contained in:
Jonatan Rek 2025-01-21 16:27:23 +01:00
parent 556fe5920e
commit bbac6a5e2e

18
app.py
View File

@ -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."""