Skip to content

Commit

Permalink
fix for issue #21, original order
Browse files Browse the repository at this point in the history
  • Loading branch information
noeltimothy committed Nov 17, 2023
1 parent e7b3c5d commit 2fdd59e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ def sha_encode(values):
def get_hex_sorted(values, sort=True):
if not isinstance(values, list):
values = [ values ]
c = [ x[2:] for x in values if x not in GREASE_TABLE]

# remove GREASE and calculate length
c = [ x[2:] for x in values if x not in GREASE_TABLE ]
actual_length = len(c)
# now remove SNI and ALPN values
c = [ x for x in c if x not in ['0000', '0010']]

# remove SNI and ALPN values
unwanted = { '0000', '0010' }
c = list(set(c).difference(unwanted))
c.sort() if sort else None

return ','.join(c), '{:02d}'.format(actual_length), sha_encode(c)
Expand Down

0 comments on commit 2fdd59e

Please sign in to comment.