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 cee3bfb commit 8cebde5Copy full SHA for 8cebde5
pyinjective/core/network.py
@@ -86,12 +86,11 @@ def _is_cookie_expired(self, cookie_data: str) -> bool:
86
cookie = SimpleCookie()
87
cookie.load(cookie_data)
88
89
- if "GCLB" not in cookie:
+ expiration_data: Optional[str] = cookie.get("GCLB", {}).get("expires", None)
90
+ if expiration_data is None:
91
expiration_time = 0
92
else:
- expiration_time = datetime.datetime.strptime(
93
- cookie["GCLB"]["expires"], "%a, %d-%b-%Y %H:%M:%S %Z"
94
- ).timestamp()
+ expiration_time = datetime.datetime.strptime(expiration_data, "%a, %d-%b-%Y %H:%M:%S %Z").timestamp()
95
96
timestamp_diff = expiration_time - time.time()
97
return timestamp_diff < self.SESSION_RENEWAL_OFFSET
0 commit comments