diff --git a/sharex_server.py b/sharex_server.py index 6cbdbfa..77615f4 100644 --- a/sharex_server.py +++ b/sharex_server.py @@ -8,7 +8,7 @@ from collections import defaultdict from Cryptodome.Cipher import AES from Cryptodome.Util import Padding -from aiohttp import web +from aiohttp import web, hdrs class AttrDict(dict): @@ -126,8 +126,10 @@ async def handle_download(req, acc, acc_db): fhash = req.match_info.get('hash', '').split('.', 1)[0] if fhash not in acc_db: return web.Response(text='file not found', status=404) + return web.FileResponse(f"{conf.data_path}/{acc}/{fhash}_{acc_db[fhash]}", headers={ - 'CONTENT-DISPOSITION': f'inline;filename="{acc_db[fhash]}"' + hdrs.CACHE_CONTROL: "no-cache", + hdrs.CONTENT_DISPOSITION: f'inline;filename="{acc_db[fhash]}"' })