Map dict to headers list

This commit is contained in:
DenisKolodin
2015-08-22 18:15:46 +03:00
parent d00154724b
commit 0fdbb59a2a

View File

@@ -92,7 +92,10 @@ def _get_handshake_headers(resource, host, port, options):
headers.append("Sec-WebSocket-Protocol: %s" % ",".join(subprotocols)) headers.append("Sec-WebSocket-Protocol: %s" % ",".join(subprotocols))
if "header" in options: 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) cookie = options.get("cookie", None)