MCPcopy Create free account
hub / github.com/apache/impala / get_cookie_expiry

Function get_cookie_expiry

shell/impala_shell/cookie_util.py:43–51  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

41
42
43def get_cookie_expiry(c):
44 if 'max-age' in c and c['max-age']:
45 try:
46 max_age_sec = int(c['max-age'])
47 return datetime.datetime.now() + datetime.timedelta(seconds=max_age_sec)
48 except Exception:
49 pass
50 # TODO: implement support for 'expires' cookie attribute as well.
51 return None
52
53
54def get_cookies(resp_headers):

Callers 2

Calls 1

nowMethod · 0.80

Tested by 1