diff options
Diffstat (limited to 'matweb/utils.py')
| -rw-r--r-- | matweb/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/matweb/utils.py b/matweb/utils.py index f4cbca3..270c5f3 100644 --- a/matweb/utils.py +++ b/matweb/utils.py | |||
| @@ -2,6 +2,7 @@ import hmac | |||
| 2 | import os | 2 | import os |
| 3 | import hashlib | 3 | import hashlib |
| 4 | import mimetypes as mtype | 4 | import mimetypes as mtype |
| 5 | from typing import Tuple | ||
| 5 | 6 | ||
| 6 | from flask_restful import abort, current_app | 7 | from flask_restful import abort, current_app |
| 7 | from libmat2 import parser_factory | 8 | from libmat2 import parser_factory |
| @@ -97,7 +98,7 @@ def get_file_paths(filename, upload_folder): | |||
| 97 | return complete_path, filepath | 98 | return complete_path, filepath |
| 98 | 99 | ||
| 99 | 100 | ||
| 100 | def is_valid_api_download_file(filename: str, key: str, secret: str, upload_folder: str) -> [str, str]: | 101 | def is_valid_api_download_file(filename: str, key: str, secret: str, upload_folder: str) -> Tuple[str, str]: |
| 101 | if filename != secure_filename(filename): | 102 | if filename != secure_filename(filename): |
| 102 | current_app.logger.error('Insecure filename %s', filename) | 103 | current_app.logger.error('Insecure filename %s', filename) |
| 103 | abort(400, message='Insecure filename') | 104 | abort(400, message='Insecure filename') |
