]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Only invoke select_subprotocol() when the client requests it 2282/head
authorBrandon Holbrook <bholbrook@bomgar.com>
Wed, 21 Feb 2018 02:22:54 +0000 (20:22 -0600)
committerBrandon Holbrook <bholbrook@bomgar.com>
Wed, 21 Feb 2018 02:22:54 +0000 (20:22 -0600)
tornado/websocket.py

index 53832d2b1245f660c06d335e27e834d619ff91a8..5d66075d7e27f038a49cdcfc555334c73ab5db7c 100644 (file)
@@ -662,8 +662,7 @@ class WebSocketProtocol13(WebSocketProtocol):
             self.request.headers.get("Sec-Websocket-Key"))
 
     def _accept_connection(self):
-        subprotocols = self.request.headers.get("Sec-WebSocket-Protocol", '')
-        subprotocols = [s.strip() for s in subprotocols.split(',')]
+        subprotocols = [s.strip() for s in self.request.headers.get_list("Sec-WebSocket-Protocol")]
         if subprotocols:
             selected = self.handler.select_subprotocol(subprotocols)
             if selected: