Skip to content

add BadRequestKeyError.show_exception#1592

Merged
davidism merged 1 commit into0.15.xfrom
keyerror
Jun 25, 2019
Merged

add BadRequestKeyError.show_exception#1592
davidism merged 1 commit into0.15.xfrom
keyerror

Conversation

@davidism
Copy link
Copy Markdown
Member

See pallets/flask#3249. The behavior introduced in 0.15.0 was to show the error unless e.args was empty. However, this makes it impossible for an error handler to know what the missing key was.

Instead, add a show_exception attribute to explicitly control the behavior. This defaults to false for a more secure default behavior. Now Flask can do:

if app.debug:
    e.show_exception = True

While this is technically not backwards compatible, it adds information overall and sets a more secure default, and it was a fairly obscure and recent change to begin with, so I'm comfortable adding this to 0.15.5.

@davidism davidism added this to the 0.15.5 milestone Jun 25, 2019
@davidism davidism merged commit 5aa9c15 into 0.15.x Jun 25, 2019
@davidism davidism deleted the keyerror branch June 25, 2019 21:09
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant