Make WebSockt upgrade header case insensitive

This commit is contained in:
Andrew Godwin 2016-02-23 21:25:26 +00:00
parent 07801e9ae8
commit cacce0493d

View File

@ -44,7 +44,7 @@ class WebRequest(http.Request):
if b"?" in self.uri: if b"?" in self.uri:
self.query_string = self.uri.split(b"?", 1)[1] self.query_string = self.uri.split(b"?", 1)[1]
# Is it WebSocket? IS IT?! # Is it WebSocket? IS IT?!
if upgrade_header == b"websocket": if upgrade_header.lower() == b"websocket":
# Make WebSocket protocol to hand off to # Make WebSocket protocol to hand off to
protocol = self.factory.ws_factory.buildProtocol(self.transport.getPeer()) protocol = self.factory.ws_factory.buildProtocol(self.transport.getPeer())
if not protocol: if not protocol: