Currently, breach.py relies on the downloading framework using gzip. Make that explicit and/or download the page with these parameters.
Also, we can simplify the implementation. For example,
def check_for_compression(headers):
if "Content-Encoding" in headers:
encoding = headers["Content-Encoding"]
return "GZIP" in encoding or "gzip" in encoding
else:
return False
can be written as
check_for_compression = lambda hdr: 'gzip' in hdr.get('Content-Encoding', '').lower()
Additionally, the return mechanism of check_for_secret is overly complicated and probably incorrect.
Currently, breach.py relies on the downloading framework using gzip. Make that explicit and/or download the page with these parameters.
Also, we can simplify the implementation. For example,
can be written as
Additionally, the return mechanism of
check_for_secret
is overly complicated and probably incorrect.