Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ws4py/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ def handshake_headers(self):
handshake.
"""
headers = [
('Host', '%s:%s' % (self.host, self.port)),
('Connection', 'Upgrade'),
('Upgrade', 'websocket'),
('Sec-WebSocket-Key', self.key.decode('utf-8')),
Expand All @@ -266,6 +265,10 @@ def handshake_headers(self):
if self.extra_headers:
headers.extend(self.extra_headers)

if not any(x for x in headers if x[0].lower() == 'host') and \
'host' not in self.exclude_headers:
headers.append(('Host', '%s:%s' % (self.host, self.port)))

if not any(x for x in headers if x[0].lower() == 'origin') and \
'origin' not in self.exclude_headers:

Expand Down