added max_form_parts

This commit is contained in:
Stepan 2023-07-17 10:07:49 +03:00
parent cb825687a5
commit d68edf108b
2 changed files with 9 additions and 0 deletions

View file

@ -309,6 +309,7 @@ class Flask(Scaffold):
"SESSION_COOKIE_SAMESITE": None,
"SESSION_REFRESH_EACH_REQUEST": True,
"MAX_CONTENT_LENGTH": None,
"MAX_FORM_PARTS": 5000,
"SEND_FILE_MAX_AGE_DEFAULT": None,
"TRAP_BAD_REQUEST_ERRORS": None,
"TRAP_HTTP_EXCEPTIONS": False,

View file

@ -59,6 +59,14 @@ class Request(RequestBase):
else:
return None
@property
def max_form_parts(self) -> int | None: # type: ignore
"""Read-only view of the ``MAX_FORM_PARTS`` config key."""
if current_app:
return current_app.config["MAX_FORM_PARTS"]
else:
return None
@property
def endpoint(self) -> str | None:
"""The endpoint that matched the request URL.