Update server.py

This commit is contained in:
Namhyeon Go 2024-02-21 01:52:26 +09:00 committed by GitHub
parent 9b78e214d0
commit 8fd2b699c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,7 +170,11 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
return False
# convert to text
data_length = len(data)
text = data.decode(client_encoding, errors='ignore')
error_rate = (data_length - len(text)) / data_length
if error_rate > 0.9:
return False
# check ID with K-Anonymity strategy
pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b'