In the code utils.py/cookie_from_string() parses Cookie string and return "max_age" attribute value as string. Then the code sends this value to Django "set_cookie()
revproxy/response.py
if cookie_dict: response.set_cookie(**cookie_dict)
Which causes exception:
File "/Users/sp/dev/opb-project/openplantbook/venv/lib/python3.9/site-packages/django/http/response.py", line 224, in set_cookie self.cookies[key]['expires'] = http_date(time.time() + max_age) TypeError: unsupported operand type(s) for +: 'float' and 'str'
max_age should be an integer number of seconds, or None (default) if the cookie should last only as long as the client’s browser session. If expires is not specified, it will be calculated.
In the code utils.py/cookie_from_string() parses Cookie string and return "max_age" attribute value as string. Then the code sends this value to Django "set_cookie()
revproxy/response.py
if cookie_dict: response.set_cookie(**cookie_dict)
Which causes exception:File "/Users/sp/dev/opb-project/openplantbook/venv/lib/python3.9/site-packages/django/http/response.py", line 224, in set_cookie self.cookies[key]['expires'] = http_date(time.time() + max_age) TypeError: unsupported operand type(s) for +: 'float' and 'str'
This is because:
HttpResponse.set_cookie(key, value='', max_age=None, expires=None, path='/', domain=None, secure=False, httponly=False, samesite=None)
Expects max_age as integer:
max_age should be an integer number of seconds, or None (default) if the cookie should last only as long as the client’s browser session. If expires is not specified, it will be calculated.