mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-30 11:38:36 -07:00
Bump websocket-client from 1.3.2 to 1.4.2 (#1886)
* Bump websocket-client from 1.3.2 to 1.4.2 Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.3.2 to 1.4.2. - [Release notes](https://github.com/websocket-client/websocket-client/releases) - [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog) - [Commits](https://github.com/websocket-client/websocket-client/compare/v1.3.2...v1.4.2) --- updated-dependencies: - dependency-name: websocket-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update websocket-client==1.4.2 Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
a5ccc9a1a3
commit
3af08f0d07
10 changed files with 177 additions and 101 deletions
|
@ -81,7 +81,7 @@ def _get_handshake_headers(resource, url, host, port, options):
|
|||
hostport = _pack_hostname(host)
|
||||
else:
|
||||
hostport = "%s:%d" % (_pack_hostname(host), port)
|
||||
if "host" in options and options["host"] is not None:
|
||||
if options.get("host"):
|
||||
headers.append("Host: %s" % options["host"])
|
||||
else:
|
||||
headers.append("Host: %s" % hostport)
|
||||
|
@ -89,7 +89,7 @@ def _get_handshake_headers(resource, url, host, port, options):
|
|||
# scheme indicates whether http or https is used in Origin
|
||||
# The same approach is used in parse_url of _url.py to set default port
|
||||
scheme, url = url.split(":", 1)
|
||||
if "suppress_origin" not in options or not options["suppress_origin"]:
|
||||
if not options.get("suppress_origin"):
|
||||
if "origin" in options and options["origin"] is not None:
|
||||
headers.append("Origin: %s" % options["origin"])
|
||||
elif scheme == "wss":
|
||||
|
@ -100,16 +100,15 @@ def _get_handshake_headers(resource, url, host, port, options):
|
|||
key = _create_sec_websocket_key()
|
||||
|
||||
# Append Sec-WebSocket-Key & Sec-WebSocket-Version if not manually specified
|
||||
if 'header' not in options or 'Sec-WebSocket-Key' not in options['header']:
|
||||
key = _create_sec_websocket_key()
|
||||
if not options.get('header') or 'Sec-WebSocket-Key' not in options['header']:
|
||||
headers.append("Sec-WebSocket-Key: %s" % key)
|
||||
else:
|
||||
key = options['header']['Sec-WebSocket-Key']
|
||||
|
||||
if 'header' not in options or 'Sec-WebSocket-Version' not in options['header']:
|
||||
if not options.get('header') or 'Sec-WebSocket-Version' not in options['header']:
|
||||
headers.append("Sec-WebSocket-Version: %s" % VERSION)
|
||||
|
||||
if 'connection' not in options or options['connection'] is None:
|
||||
if not options.get('connection'):
|
||||
headers.append('Connection: Upgrade')
|
||||
else:
|
||||
headers.append(options['connection'])
|
||||
|
@ -118,8 +117,8 @@ def _get_handshake_headers(resource, url, host, port, options):
|
|||
if subprotocols:
|
||||
headers.append("Sec-WebSocket-Protocol: %s" % ",".join(subprotocols))
|
||||
|
||||
if "header" in options:
|
||||
header = options["header"]
|
||||
header = options.get("header")
|
||||
if header:
|
||||
if isinstance(header, dict):
|
||||
header = [
|
||||
": ".join([k, v])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue