w-digital-scanner / w13scan

Passive Security Scanner (被动式安全扫描器)
GNU General Public License v2.0
1.9k stars 360 forks source link

update Accept-Encoding header setting #518

Closed osxtest closed 2 years ago

osxtest commented 2 years ago

the original way of handling Accept-Encoding header will turn out result below, which is not perfect enough

>>> 'gzip, br, compress'.replace('br', '')
'gzip, , compress'

so I manage another way to solve that problem and open this PR, tests are down below

>>> vt = ["gzip,br", "br, gzip", "gzip, br,compress", "br"]
>>> for v in vt:
...     vl = [x.strip(" ") for x in v.split(",")]
...     print(", ".join(list(filter(lambda x: x != "br", vl))))
... 
gzip
gzip
gzip, compress

>>>