From 2978c73ed50e51ab7ef601f529ce214b50a7b8d2 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 17 Feb 2024 21:53:55 +0900 Subject: [PATCH] Update server.py --- server.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/server.py b/server.py index e82848d..e525aa5 100644 --- a/server.py +++ b/server.py @@ -132,17 +132,14 @@ def proxy_connect(webserver, conn): def proxy_check_filtered(response, webserver, port): filtered = False - try: - text = response.decode(client_encoding) - - filtered = text.find('@misskey.io') > -1 or text.find('ctkpaarr') > -1 or re.search(r'\b\w{10}@\w+\.\w+\b', text) - if filtered: - print ("[*] filtered from %s:%s" % (webserver.decode(client_encoding), str(port))) - print ("[*] ====== start response data =====") - print ("%s" % (text)) - print ("[*] ====== end response data =====") - except: - print ("[*] multimedia is allowed") + text = response.decode(client_encoding, errors='ignore') + + filtered = text.find('@misskey.io') > -1 or text.find('ctkpaarr') > -1 or re.search(r'\b\w{10}@\w+\.\w+\b', text) + if filtered: + print ("[*] filtered from %s:%s" % (webserver.decode(client_encoding), str(port))) + #print ("[*] ====== start response data =====") + #print ("%s" % (text)) + #print ("[*] ====== end response data =====") return filtered