Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add BadRequestKeyError.show_exception #1592

Merged
merged 1 commit into from Jun 25, 2019
Merged

add BadRequestKeyError.show_exception #1592

merged 1 commit into from Jun 25, 2019

Conversation

@davidism
Copy link
Member

@davidism davidism commented Jun 25, 2019

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
1 check failed
@davidism davidism deleted the keyerror branch Jun 25, 2019
@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant