mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-05-29 21:17:05 +00:00
Update server.py
This commit is contained in:
parent
9b78e214d0
commit
8fd2b699c7
|
@ -170,7 +170,11 @@ def proxy_check_filtered(data, webserver, port, scheme, method, url):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# convert to text
|
# convert to text
|
||||||
|
data_length = len(data)
|
||||||
text = data.decode(client_encoding, errors='ignore')
|
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
|
# check ID with K-Anonymity strategy
|
||||||
pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b'
|
pattern = r'\b(?:(?<=\/@)|(?<=acct:))([a-zA-Z0-9]{10})\b'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user