From 436bcd121b9592b078ead3d32072415f702cc099 Mon Sep 17 00:00:00 2001 From: Aditya Bansal Date: Sat, 1 Sep 2018 17:45:02 +0530 Subject: [PATCH] zthumbor: Fix thumbor behaviour when using it with s3 storage. --- zthumbor/loaders/zloader.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zthumbor/loaders/zloader.py b/zthumbor/loaders/zloader.py index 387f4bf476..c7ea65103c 100644 --- a/zthumbor/loaders/zloader.py +++ b/zthumbor/loaders/zloader.py @@ -35,6 +35,11 @@ def load(context, url, callback): return if source_type == THUMBOR_S3_TYPE: + if actual_url.startswith('/user_uploads/'): # type: ignore # python 2 type differs from python 3 type + actual_url = actual_url[len('/user_uploads/'):] + else: + raise AssertionError("Unexpected s3 file.") + s3_loader.load(context, actual_url, callback) elif source_type == THUMBOR_LOCAL_FILE_TYPE: if actual_url.startswith('/user_uploads/'): # type: ignore # python 2 type differs from python 3 type