From 3263434b666472aac1a458a64564ef14a6e3cbd7 Mon Sep 17 00:00:00 2001 From: stephen-st Date: Sun, 23 Sep 2018 12:44:53 +0200 Subject: [PATCH] Wrapper: Ensure Request max_content returns None - Otherwise returns property object for else logic - Safe handling of key/app existence --- flask/wrappers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flask/wrappers.py b/flask/wrappers.py index 12eff2c7..fe1ada15 100644 --- a/flask/wrappers.py +++ b/flask/wrappers.py @@ -145,8 +145,7 @@ class Request(RequestBase, JSONMixin): @property def max_content_length(self): """Read-only view of the ``MAX_CONTENT_LENGTH`` config key.""" - if current_app: - return current_app.config['MAX_CONTENT_LENGTH'] + return current_app.config.get('MAX_CONTENT_LENGTH') if current_app else None: @property def endpoint(self):