diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-05-03 00:01:03 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-05-03 00:06:37 +0300 |
commit | 38934cfb0b963a0157cf16c13499977ac87f35b9 (patch) | |
tree | 124d141726b8a860761a75fe2b597eecce078ee7 /contrib/python/Flask/py3/flask/wrappers.py | |
parent | 616419d508d3ee4a3b07a82e5cae5ab4544bd1e2 (diff) | |
download | ydb-38934cfb0b963a0157cf16c13499977ac87f35b9.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/Flask/py3/flask/wrappers.py')
-rw-r--r-- | contrib/python/Flask/py3/flask/wrappers.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/python/Flask/py3/flask/wrappers.py b/contrib/python/Flask/py3/flask/wrappers.py index 47dbe5c8d8..7153876b8d 100644 --- a/contrib/python/Flask/py3/flask/wrappers.py +++ b/contrib/python/Flask/py3/flask/wrappers.py @@ -9,7 +9,6 @@ from .globals import current_app from .helpers import _split_blueprint_path if t.TYPE_CHECKING: - import typing_extensions as te from werkzeug.routing import Rule @@ -110,7 +109,7 @@ class Request(RequestBase): return _split_blueprint_path(name) def _load_form_data(self) -> None: - RequestBase._load_form_data(self) + super()._load_form_data() # In debug mode we're replacing the files multidict with an ad-hoc # subclass that raises a different error for key errors. @@ -124,11 +123,14 @@ class Request(RequestBase): attach_enctype_error_multidict(self) - def on_json_loading_failed(self, e: Exception) -> "te.NoReturn": - if current_app and current_app.debug: - raise BadRequest(f"Failed to decode JSON object: {e}") + def on_json_loading_failed(self, e: t.Optional[ValueError]) -> t.Any: + try: + return super().on_json_loading_failed(e) + except BadRequest as e: + if current_app and current_app.debug: + raise - raise BadRequest() + raise BadRequest() from e class Response(ResponseBase): @@ -153,6 +155,8 @@ class Response(ResponseBase): json_module = json + autocorrect_location_header = False + @property def max_cookie_size(self) -> int: # type: ignore """Read-only view of the :data:`MAX_COOKIE_SIZE` config key. |