From: Ben Darnell Date: Sun, 22 Jan 2012 01:28:07 +0000 (-0800) Subject: Merge remote-tracking branch 'MrJoes/master' into work X-Git-Tag: v2.2.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3beb8ce4801a59f6e81404957858d8df71f5cbbc;p=thirdparty%2Ftornado.git Merge remote-tracking branch 'MrJoes/master' into work Conflicts: tornado/websocket.py --- 3beb8ce4801a59f6e81404957858d8df71f5cbbc diff --cc tornado/websocket.py index f240b932c,ce2af8600..273dbc183 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@@ -253,17 -233,8 +282,18 @@@ class WebSocketProtocol76(WebSocketProt logging.debug("Malformed WebSocket request received") self._abort() return + - scheme = "wss" if self.request.protocol == "https" else "ws" + scheme = self.handler.get_websocket_scheme() + + # draft76 only allows a single subprotocol + subprotocol_header = '' + subprotocol = self.request.headers.get("Sec-WebSocket-Protocol", None) + if subprotocol: + selected = self.handler.select_subprotocol([subprotocol]) + if selected: + assert selected == subprotocol + subprotocol_header = "Sec-WebSocket-Protocol: %s\r\n" % selected + # Write the initial headers before attempting to read the challenge. # This is necessary when using proxies (such as HAProxy), which # need to see the Upgrade headers before passing through the