mirror of
https://github.com/Kozea/Radicale.git
synced 2025-07-02 16:58:30 +00:00
Limit size of request body
This commit is contained in:
parent
b55d2181ed
commit
e438d9fd4b
3 changed files with 10 additions and 0 deletions
|
@ -301,6 +301,12 @@ class Application:
|
|||
# Get content
|
||||
content_length = int(environ.get("CONTENT_LENGTH") or 0)
|
||||
if content_length:
|
||||
max_content_length = self.configuration.getint(
|
||||
"server", "max_content_length")
|
||||
if max_content_length and content_length > max_content_length:
|
||||
self.logger.debug(
|
||||
"Request body too large: %d", content_length)
|
||||
return response(client.REQUEST_ENTITY_TOO_LARGE)
|
||||
try:
|
||||
content = self.decode(
|
||||
environ["wsgi.input"].read(content_length), environ)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue