diff --git a/uweb3/__init__.py b/uweb3/__init__.py index 4315f66..4644e76 100644 --- a/uweb3/__init__.py +++ b/uweb3/__init__.py @@ -122,15 +122,15 @@ def _create_request(self, env): # Attempt to load the max request size setting from the config try: - max_request_body_size = self.config.options["general"][ - "max_request_body_size" - ] - except Exception: + max_request_body_size = int( + self.config.options["general"]["max_request_body_size"] + ) + except KeyError: pass try: remote_addr_config = self.config.options["headers"] - except Exception: + except KeyError: pass if max_request_body_size: