From edbad6606630bf97dc356db62434ce6092bcf3e2 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Sat, 19 Nov 2022 22:35:52 +0300 Subject: [PATCH] Fix JPG Requests Requests to the get file endpoint for JPEG files would always fail since the regex incorrectly specified PDF twice, but not JPG. --- src/api2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api2.py b/src/api2.py index 6b856b2..5539050 100644 --- a/src/api2.py +++ b/src/api2.py @@ -41,7 +41,7 @@ async def post(request): async def get(request): filename = request.match_info['filename'] - if not re.match(r'^[A-Za-z0-9]{64}\.(pdf|png|pdf)$', filename): + if not re.match(r'^[A-Za-z0-9]{64}\.(jpg|png|pdf)$', filename): logs.info('{} not found'.format(filename)) raise aiohttp.web.HTTPBadRequest path = './temp/' + filename.replace('.', '/a.')