fix http_simple a bug of urlencode length
This commit is contained in:
parent
5e46aa0b47
commit
24a3769809
1 changed files with 6 additions and 2 deletions
|
@ -133,9 +133,13 @@ class http_simple(plain.plain):
|
|||
hex_items = lines[0].split(b'%')
|
||||
if hex_items and len(hex_items) > 1:
|
||||
for index in range(1, len(hex_items)):
|
||||
if len(hex_items[index]) != 2:
|
||||
if len(hex_items[index]) < 2:
|
||||
ret_buf += binascii.unhexlify('0' + hex_items[index])
|
||||
break
|
||||
elif len(hex_items[index]) > 2:
|
||||
ret_buf += binascii.unhexlify(hex_items[index][:2])
|
||||
break
|
||||
else:
|
||||
ret_buf += binascii.unhexlify(hex_items[index])
|
||||
return ret_buf
|
||||
return b''
|
||||
|
|
Loading…
Add table
Reference in a new issue