Skip to content

Commit

Permalink
Convert max_request_body_size to int. Only pass on KeyError so that o…
Browse files Browse the repository at this point in the history
…ther errors appear in logs
  • Loading branch information
stefvanhouten committed Nov 28, 2022
1 parent 9d7477c commit 5b9c530
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions uweb3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5b9c530

Please sign in to comment.