Bump websocket-client from 1.7.0 to 1.8.0 (#2313)

* Bump websocket-client from 1.7.0 to 1.8.0

Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.7.0 to 1.8.0.
- [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.7.0...v1.8.0)

---
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.8.0

---------

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:
dependabot[bot] 2024-05-09 22:28:14 -07:00 committed by GitHub
parent 5d0ba8b222
commit dab46249f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 225 additions and 184 deletions

View file

@ -5,7 +5,7 @@ from typing import Optional
_cookiejar.py
websocket - WebSocket client library for Python
Copyright 2023 engn33r
Copyright 2024 engn33r
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -23,13 +23,13 @@ limitations under the License.
class SimpleCookieJar:
def __init__(self) -> None:
self.jar: dict = dict()
self.jar: dict = {}
def add(self, set_cookie: Optional[str]) -> None:
if set_cookie:
simpleCookie = http.cookies.SimpleCookie(set_cookie)
simple_cookie = http.cookies.SimpleCookie(set_cookie)
for k, v in simpleCookie.items():
for v in simple_cookie.values():
if domain := v.get("domain"):
if not domain.startswith("."):
domain = f".{domain}"
@ -38,25 +38,25 @@ class SimpleCookieJar:
if self.jar.get(domain)
else http.cookies.SimpleCookie()
)
cookie.update(simpleCookie)
cookie.update(simple_cookie)
self.jar[domain.lower()] = cookie
def set(self, set_cookie: str) -> None:
if set_cookie:
simpleCookie = http.cookies.SimpleCookie(set_cookie)
simple_cookie = http.cookies.SimpleCookie(set_cookie)
for k, v in simpleCookie.items():
for v in simple_cookie.values():
if domain := v.get("domain"):
if not domain.startswith("."):
domain = f".{domain}"
self.jar[domain.lower()] = simpleCookie
self.jar[domain.lower()] = simple_cookie
def get(self, host: str) -> str:
if not host:
return ""
cookies = []
for domain, simpleCookie in self.jar.items():
for domain, _ in self.jar.items():
host = host.lower()
if host.endswith(domain) or host == domain[1:]:
cookies.append(self.jar.get(domain))
@ -66,7 +66,7 @@ class SimpleCookieJar:
None,
sorted(
[
"%s=%s" % (k, v.value)
f"{k}={v.value}"
for cookie in filter(None, cookies)
for k, v in cookie.items()
]