Skip to content

Commit

Permalink
Merge 82e446e into fd77567
Browse files Browse the repository at this point in the history
  • Loading branch information
riot committed Jun 12, 2016
2 parents fd77567 + 82e446e commit 92d4e3d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion circuits/web/websockets/dispatcher.py
Expand Up @@ -57,7 +57,8 @@ def _on_request(self, event, request, response):
self._protocol_version = 13
headers = request.headers
sec_key = headers.get("Sec-WebSocket-Key", "").encode("utf-8")

prot = headers.get("Sec-WebSocket-Protocol", "NONE")

connection_tokens = [s.strip() for s in
headers.get("Connection", "").lower().split(",")]

Expand Down Expand Up @@ -88,6 +89,8 @@ def _on_request(self, event, request, response):
response.headers["Upgrade"] = "WebSocket"
response.headers["Connection"] = "Upgrade"
response.headers["Sec-WebSocket-Accept"] = accept.decode()
response.headers["Sec-WebSocket-Protocol"] = prot # We hear you

codec = WebSocketCodec(request.sock, channel=self._wschannel)
self._codecs[request.sock] = codec
codec.register(self)
Expand Down

0 comments on commit 92d4e3d

Please sign in to comment.