diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index ca2b3ca..e0753fe 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -4730,15 +4730,16 @@ class SidebandCore(): # invalid certificate to the server. This will always # happen from some clients when using a self-signed # certificate, so we don't care. - server.BaseHTTPRequestHandler.handle_orig = server.BaseHTTPRequestHandler.handle - def handle(self): - try: - self.handle_orig() - except ssl.SSLError: - pass - except Exception as e: - RNS.log("HTTP server exception: "+str(e), RNS.LOG_ERROR) - server.BaseHTTPRequestHandler.handle = handle + if not hasattr(server.BaseHTTPRequestHandler, "handle_orig"): + server.BaseHTTPRequestHandler.handle_orig = server.BaseHTTPRequestHandler.handle + def handle(self): + try: + self.handle_orig() + except ssl.SSLError: + pass + except Exception as e: + RNS.log("HTTP server exception: "+str(e), RNS.LOG_ERROR) + server.BaseHTTPRequestHandler.handle = handle ####################################################### socketserver.TCPServer.allow_reuse_address = True