From 8ab99e446acb68219ecd5a4813cba2ad04ea37e5 Mon Sep 17 00:00:00 2001 From: Timothy Noel Date: Fri, 17 Nov 2023 14:43:24 -0500 Subject: [PATCH] fix for issue #21, original order (#25) --- python/common.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/common.py b/python/common.py index b1228e5..c397ecb 100644 --- a/python/common.py +++ b/python/common.py @@ -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)