Fix: Session timeout lead to 500 error

This commit is contained in:
s3lph 2020-02-05 00:34:22 +01:00
parent dddd9c75be
commit 6026f21a60
5 changed files with 19 additions and 5 deletions

View file

@ -1,7 +1,20 @@
# Matemat Changelog # Matemat Changelog
<!-- BEGIN RELEASE v0.2.3 -->
## Version 0.2.3
Bugfix fix release
### Changes
<!-- BEGIN CHANGES 0.2.3 -->
- Fix: Session timeout lead to 500 error
<!-- END CHANGES 0.2.3 -->
<!-- END RELEASE v0.2.3 -->
<!-- BEGIN RELEASE v0.2.2 --> <!-- BEGIN RELEASE v0.2.2 -->
## Version 0.2.1 ## Version 0.2.2
Security fix release Security fix release

View file

@ -1,2 +1,2 @@
__version__ = '0.2.2' __version__ = '0.2.3'

View file

@ -33,7 +33,8 @@ def start() -> str:
# Check for session timeout # Check for session timeout
if session_id in __session_vars and __session_vars[session_id][0] < now: if session_id in __session_vars and __session_vars[session_id][0] < now:
end(session_id) end(session_id)
raise TimeoutError('Session timed out.') # Create new session ID after terminating the previous session
session_id = str(uuid4())
# Update or initialize the session timeout # Update or initialize the session timeout
if session_id not in __session_vars: if session_id not in __session_vars:
__session_vars[session_id] = (now + timedelta(seconds=_SESSION_TIMEOUT)), dict() __session_vars[session_id] = (now + timedelta(seconds=_SESSION_TIMEOUT)), dict()

View file

@ -2,7 +2,7 @@
# Maintainer: s3lph <account-gitlab-ideynizv@kernelpanic.lol> # Maintainer: s3lph <account-gitlab-ideynizv@kernelpanic.lol>
pkgname=matemat pkgname=matemat
pkgver=0.2.2 pkgver=0.2.3
pkgrel=1 pkgrel=1
arch=('any') arch=('any')

View file

@ -1,5 +1,5 @@
Package: matemat Package: matemat
Version: 0.2.2 Version: 0.2.3
Maintainer: s3lph <account-gitlab-ideynizv@kernelpanic.lol> Maintainer: s3lph <account-gitlab-ideynizv@kernelpanic.lol>
Section: web Section: web
Priority: optional Priority: optional