mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix cookie with Max-Age processing
When cookie has Max-Age set it tries to get expiration by adding to a timestamp. Without this patch the timestamp would be set to None and thus the addition of timestamp + max_age fails https://pagure.io/freeipa/issue/6718 Reviewed-By: Simo Sorce <ssorce@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
d1c5d92897
commit
24eeb4d6a3
@@ -759,9 +759,11 @@ class KerbTransport(SSLTransport):
|
||||
session_cookie = None
|
||||
try:
|
||||
for cookie in cookie_header:
|
||||
session_cookie = \
|
||||
Cookie.get_named_cookie_from_string(cookie, COOKIE_NAME,
|
||||
request_url)
|
||||
session_cookie = (
|
||||
Cookie.get_named_cookie_from_string(
|
||||
cookie, COOKIE_NAME, request_url,
|
||||
timestamp=datetime.datetime.utcnow())
|
||||
)
|
||||
if session_cookie is not None:
|
||||
break
|
||||
except Exception as e:
|
||||
@@ -861,7 +863,9 @@ class RPCClient(Connectible):
|
||||
|
||||
# Search for the session cookie within the cookie string
|
||||
try:
|
||||
session_cookie = Cookie.get_named_cookie_from_string(cookie_string, COOKIE_NAME)
|
||||
session_cookie = Cookie.get_named_cookie_from_string(
|
||||
cookie_string, COOKIE_NAME,
|
||||
timestamp=datetime.datetime.utcnow())
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user