stomp_ws_py icon indicating copy to clipboard operation
stomp_ws_py copied to clipboard

Error If frame data contains a colon (:)

Open ikelly247 opened this issue 2 years ago • 1 comments

2023-11-10 08:56:41,271 - ERROR - error from callback <bound method Client._on_message of <stomp_ws.client.Client object at 0x7f910537ce50>>: too many values to unpack (expected 2)

This line in frame.py: (key, value) = lines[i].split(':')

Just needs adjusting to account for the case of value containing a colon, e.g. key_and_val = lines[i].split(':',2) headers[key_and_val[0]] = key_and_val[1]

ikelly247 avatar Nov 10 '23 09:11 ikelly247

# get all headers
i = 1
while lines[i] != "":
    # get key, value from raw header
    (key, value) = lines[i].split(":", 1)
    headers[key] = value
    i += 1

Sathvik-Rao avatar Jan 11 '25 19:01 Sathvik-Rao