Skip to content

Commit

Permalink
fixed issues where referer was not correct (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
noeltimothy authored May 28, 2024
1 parent f1a8139 commit 903c48e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/ja4h.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def http_language(lang):

def to_ja4h(x, debug_stream=-1):
cookie = 'c' if 'cookies' in x else 'n'
referer = 'r' if 'referer' in [ y.lower() for y in x['headers'] ] else 'n'
header_fields = [y.lower().split(':')[0] for y in x['headers'] ]
referer = 'r' if 'referer' in str(header_fields) else 'n'

method = http_method(x['method'])
version = 11 if x['hl'] == 'http' else 20
unsorted_cookie_fields = []
Expand Down

0 comments on commit 903c48e

Please sign in to comment.