diff --git a/python/ja4h.py b/python/ja4h.py index 709ec81..218770a 100644 --- a/python/ja4h.py +++ b/python/ja4h.py @@ -15,14 +15,16 @@ def http_language(lang): def to_ja4h(x, debug_stream=-1): cookie = 'c' if 'cookies' in x else 'n' - referer = 'r' if 'referer' in x['headers'] else 'n' + referer = 'r' if 'referer' in [ y.lower() for y in x['headers'] ] else 'n' method = http_method(x['method']) version = 11 if x['hl'] == 'http' else 20 unsorted_cookie_fields = [] unsorted_cookie_values = [] x['headers'] = [ h.split(':')[0] for h in x['headers'] ] - x['headers'] = [ h for h in x['headers'] if not h.startswith(':') and not h.startswith('cookie') and h != 'referer' and h ] + x['headers'] = [ h for h in x['headers'] + if not h.startswith(':') and not h.lower().startswith('cookie') + and h.lower() != 'referer' and h ] raw_headers = x['headers'][:]