]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Merge remote-tracking branch 'MrJoes/master' into work
authorBen Darnell <ben@bendarnell.com>
Sun, 22 Jan 2012 01:28:07 +0000 (17:28 -0800)
committerBen Darnell <ben@bendarnell.com>
Sun, 22 Jan 2012 01:28:07 +0000 (17:28 -0800)
Conflicts:
tornado/websocket.py

1  2 
tornado/websocket.py

index f240b932c5204a0b226e73c89867152538686c7b,ce2af8600044ae828ef44acd8fd373389e432d10..273dbc183c4b52e5eb4a36d475b633a839bf6c24
@@@ -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