Commit 8c0c618df8df9077a4a4dbf29b9cf42c967d08e1
1 parent
0d5211b6
Exists in
dev
update tornado to >=6.3
Showing
3 changed files
with
6 additions
and
8 deletions
Show diff stats
perguntations/__init__.py
| ... | ... | @@ -32,10 +32,10 @@ proof of submission and for review. |
| 32 | 32 | ''' |
| 33 | 33 | |
| 34 | 34 | APP_NAME = 'perguntations' |
| 35 | -APP_VERSION = '2022.04.dev1' | |
| 35 | +APP_VERSION = '2024.06.dev1' | |
| 36 | 36 | APP_DESCRIPTION = str(__doc__) |
| 37 | 37 | |
| 38 | 38 | __author__ = 'Miguel Barão' |
| 39 | -__copyright__ = 'Copyright 2022, Miguel Barão' | |
| 39 | +__copyright__ = 'Copyright 2024, Miguel Barão' | |
| 40 | 40 | __license__ = 'MIT license' |
| 41 | 41 | __version__ = APP_VERSION | ... | ... |
perguntations/serve.py
| ... | ... | @@ -21,9 +21,7 @@ from typing import Dict, Tuple |
| 21 | 21 | import uuid |
| 22 | 22 | |
| 23 | 23 | # user installed libraries |
| 24 | -import tornado.ioloop | |
| 25 | -import tornado.web | |
| 26 | -import tornado.httpserver | |
| 24 | +import tornado | |
| 27 | 25 | |
| 28 | 26 | # this project |
| 29 | 27 | from .parser_markdown import md_to_html |
| ... | ... | @@ -103,7 +101,7 @@ class BaseHandler(tornado.web.RequestHandler): |
| 103 | 101 | Since HTTP is stateless, a cookie is used to identify the user. |
| 104 | 102 | This function returns the cookie for the current user. |
| 105 | 103 | ''' |
| 106 | - cookie = self.get_secure_cookie('perguntations_user') | |
| 104 | + cookie = self.get_signed_cookie('perguntations_user') | |
| 107 | 105 | if cookie: |
| 108 | 106 | return cookie.decode('utf-8') |
| 109 | 107 | return None |
| ... | ... | @@ -140,7 +138,7 @@ class LoginHandler(BaseHandler): |
| 140 | 138 | await asyncio.sleep(3) # delay to avoid spamming the server... |
| 141 | 139 | self.render('login.html', error=self._error_msg[error]) |
| 142 | 140 | else: |
| 143 | - self.set_secure_cookie('perguntations_user', str(uid)) | |
| 141 | + self.set_signed_cookie('perguntations_user', str(uid)) | |
| 144 | 142 | self.redirect('/') |
| 145 | 143 | |
| 146 | 144 | ... | ... |
-
mentioned in commit cc91e4c034aa4336bad33042438dd98d4f20d958