Commit d81c9789 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Fixed bug leading to tuple unpack exception

parent dbe4eecf
......@@ -357,17 +357,22 @@ class ClientHandshake(Handshake):
password=password.encode('utf-8'))
def split_stripped(value, delim=','):
return map(str.strip, str(value).split(delim)) if value else []
def split_stripped(value, delim=',', maxsplits=-1):
return map(str.strip, str(value).split(delim, maxsplits)) if value else []
def parse_param_hdr(hdr):
name, paramstr = split_stripped(hdr, ';')
if ';' in hdr:
name, paramstr = split_stripped(hdr, ';', 1)
else:
name = hdr
paramstr = ''
params = {}
for param in split_stripped(paramstr):
if '=' in param:
key, value = split_stripped(param, '=')
key, value = split_stripped(param, '=', 1)
if value.isdigit():
value = int(value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment