diff --git a/websocket/_handshake.py b/websocket/_handshake.py index 4d20fed..1292523 100644 --- a/websocket/_handshake.py +++ b/websocket/_handshake.py @@ -92,8 +92,11 @@ def _get_handshake_headers(resource, host, port, options): headers.append("Sec-WebSocket-Protocol: %s" % ",".join(subprotocols)) if "header" in options: - headers.extend(options["header"]) - + header = options["header"] + if isinstance(header, dict): + header = map(": ".join, header.items()) + headers.extend(header) + cookie = options.get("cookie", None) if cookie: