We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 961c07c commit 29cf973Copy full SHA for 29cf973
ws4py/client/__init__.py
@@ -253,7 +253,6 @@ def handshake_headers(self):
253
handshake.
254
"""
255
headers = [
256
- ('Host', '%s:%s' % (self.host, self.port)),
257
('Connection', 'Upgrade'),
258
('Upgrade', 'websocket'),
259
('Sec-WebSocket-Key', self.key.decode('utf-8')),
@@ -266,6 +265,10 @@ def handshake_headers(self):
266
265
if self.extra_headers:
267
headers.extend(self.extra_headers)
268
+ if not any(x for x in headers if x[0].lower() == 'host') and \
269
+ 'host' not in self.exclude_headers:
270
+ headers.append(('Host', '%s:%s' % (self.host, self.port)))
271
+
272
if not any(x for x in headers if x[0].lower() == 'origin') and \
273
'origin' not in self.exclude_headers:
274
0 commit comments