From fe0811d525ad6f3c0cf12b701a3ae052e8d871f4 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:21:04 -0500 Subject: [PATCH] Fix source resource always working even when expose_source is false --- kodak/resources/image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kodak/resources/image.py b/kodak/resources/image.py index 2c8f3e2..156621f 100644 --- a/kodak/resources/image.py +++ b/kodak/resources/image.py @@ -16,6 +16,9 @@ class Image(KodakResource): @authenticated def get(self, image_name: str) -> flask.Response: # pylint: disable=no-self-use """Retrieve an original source image""" + if not flask.current_app.appconfig.expose_source: + raise RuntimeError + with database.interface.atomic(): image = database.ImageRecord.get(database.ImageRecord.name == image_name)