mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Bump websocket-client from 1.6.2 to 1.7.0 (#2207)
* Bump websocket-client from 1.6.2 to 1.7.0 Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.6.2 to 1.7.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.6.2...v1.7.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.7.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:
parent
dbffb519f5
commit
24b6d37bbe
23 changed files with 1909 additions and 801 deletions
|
@ -1,4 +1,5 @@
|
|||
import http.cookies
|
||||
from typing import Optional
|
||||
|
||||
"""
|
||||
_cookiejar.py
|
||||
|
@ -22,18 +23,21 @@ limitations under the License.
|
|||
|
||||
class SimpleCookieJar:
|
||||
def __init__(self) -> None:
|
||||
self.jar = dict()
|
||||
self.jar: dict = dict()
|
||||
|
||||
def add(self, set_cookie: str) -> None:
|
||||
def add(self, set_cookie: Optional[str]) -> None:
|
||||
if set_cookie:
|
||||
simpleCookie = http.cookies.SimpleCookie(set_cookie)
|
||||
|
||||
for k, v in simpleCookie.items():
|
||||
domain = v.get("domain")
|
||||
if domain:
|
||||
if domain := v.get("domain"):
|
||||
if not domain.startswith("."):
|
||||
domain = "." + domain
|
||||
cookie = self.jar.get(domain) if self.jar.get(domain) else http.cookies.SimpleCookie()
|
||||
domain = f".{domain}"
|
||||
cookie = (
|
||||
self.jar.get(domain)
|
||||
if self.jar.get(domain)
|
||||
else http.cookies.SimpleCookie()
|
||||
)
|
||||
cookie.update(simpleCookie)
|
||||
self.jar[domain.lower()] = cookie
|
||||
|
||||
|
@ -42,10 +46,9 @@ class SimpleCookieJar:
|
|||
simpleCookie = http.cookies.SimpleCookie(set_cookie)
|
||||
|
||||
for k, v in simpleCookie.items():
|
||||
domain = v.get("domain")
|
||||
if domain:
|
||||
if domain := v.get("domain"):
|
||||
if not domain.startswith("."):
|
||||
domain = "." + domain
|
||||
domain = f".{domain}"
|
||||
self.jar[domain.lower()] = simpleCookie
|
||||
|
||||
def get(self, host: str) -> str:
|
||||
|
@ -58,7 +61,15 @@ class SimpleCookieJar:
|
|||
if host.endswith(domain) or host == domain[1:]:
|
||||
cookies.append(self.jar.get(domain))
|
||||
|
||||
return "; ".join(filter(
|
||||
None, sorted(
|
||||
["%s=%s" % (k, v.value) for cookie in filter(None, cookies) for k, v in cookie.items()]
|
||||
)))
|
||||
return "; ".join(
|
||||
filter(
|
||||
None,
|
||||
sorted(
|
||||
[
|
||||
"%s=%s" % (k, v.value)
|
||||
for cookie in filter(None, cookies)
|
||||
for k, v in cookie.items()
|
||||
]
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue