Skip to content

Commit

Permalink
Made parsing of HTTP connection header more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Aug 19, 2015
1 parent a85ac4c commit f1ce5e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion engineio/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def send(self, pkt):

def handle_get_request(self, environ, start_response):
"""Handle a long-polling GET request from the client."""
connections = environ.get('HTTP_CONNECTION', '').lower().split(',')
connections = [
s.strip()
for s in environ.get('HTTP_CONNECTION', '').lower().split(',')]
transport = environ.get('HTTP_UPGRADE', '').lower()
if 'upgrade' in connections and transport in self.upgrade_protocols:
self.server.logger.info('%s: Received request to upgrade to %s',
Expand Down

0 comments on commit f1ce5e0

Please sign in to comment.