Merge branch '1.0.x'

This commit is contained in:
David Lord 2019-06-26 14:46:10 -07:00
commit 2a2134974c
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
2 changed files with 420 additions and 410 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1797,14 +1797,14 @@ class Flask(_PackageBoundObject):
if isinstance(e, BadRequestKeyError):
if self.debug or self.config["TRAP_BAD_REQUEST_ERRORS"]:
e.show_exception = True
# Werkzeug < 0.15 doesn't add the KeyError to the 400
# message, add it in manually.
description = e.get_description()
if e.args[0] not in description:
# TODO: clean up once Werkzeug >= 0.15.5 is required
if e.args[0] not in e.get_description():
e.description = "KeyError: '{}'".format(*e.args)
else:
# Werkzeug >= 0.15 does add it, remove it in production
elif not hasattr(BadRequestKeyError, "show_exception"):
e.args = ()
if isinstance(e, HTTPException) and not self.trap_http_exception(e):