documented download endpoint

This commit is contained in:
Jan Friedli 2020-07-13 08:14:47 +02:00
parent 6aa9fa7029
commit 2c1bc2f05a
No known key found for this signature in database
GPG key ID: F945FA2FCA30549D
2 changed files with 34 additions and 0 deletions

View file

@ -72,6 +72,7 @@ class APIDownload(Resource):
def __init__(self, **kwargs):
self.upload_folder = kwargs['upload_folder']
@swag_from('./oas/download.yml')
def get(self, key: str, secret: str, filename: str):
complete_path, filepath = utils.is_valid_api_download_file(filename, key, secret, self.upload_folder)
# Make sure the file is NOT deleted on HEAD requests