diff --git a/sharex_server.py b/sharex_server.py index 7c69943..7085e63 100644 --- a/sharex_server.py +++ b/sharex_server.py @@ -127,7 +127,7 @@ async def handle_download(req, acc, acc_db): 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]}' + 'CONTENT-DISPOSITION': f'inline;filename="{acc_db[fhash]}"' }) @@ -152,7 +152,7 @@ def main(): if __name__ == '__main__': valid_hash_chars = set(string.hexdigits) file_db = defaultdict(dict) - confname = os.path.isfile(sys.argv[1:]) and sys.argv[1] or 'config.yaml' + confname = sys.argv[1] if sys.argv[1:] and os.path.isfile(sys.argv[1]) else 'config.yaml' with open(confname) as cf: conf = cast_to_ad(yaml.load(cf)) if conf.url_hash_len > 31: