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

bug-1928808: fix _report_type validation #6784

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

willkg
Copy link
Contributor

@willkg willkg commented Nov 2, 2024

This fixes _report_type validation in the TopCrashers form so it doesn't create bad Super Search queries which kick up an HTTP 500.

Previously, the form did no useful validation (why even have a form?). Now it enforces that _report_type is one of "any", "hang", or "crash" which are the only three values it should have. If it gets a different value, the form will cause the view to raise an HTTP 400 with an error saying that the _report_type value isn't one of the available choices.

I did manual testing:

  1. go to http://localhost:8000/ and chose "TopCrashers" from the dropdown in the quick navigation bar
  2. on the TopCrashers report, click through the three report types -- this should work fine
  3. now manually edit the url and change _report_type to something like "pumpkin" -- this should return an HTTP 400 error page

image

This fixes _report_type validation in the TopCrashers form so it doesn't
create bad Super Search queries which kick up an HTTP 500.

Previously, the form did no useful validation (why even have a form?).
Now it enforces that _report_type is one of "any", "hang", or "crash"
which are the only three values it should have. If it gets a different
value, the form will cause the view to raise an HTTP 400 with an error
saying that the _report_type value isn't one of the available choices.
@willkg willkg requested a review from a team as a code owner November 2, 2024 12:51
@willkg willkg added this pull request to the merge queue Nov 2, 2024
@willkg
Copy link
Contributor Author

willkg commented Nov 2, 2024

Thank you!

Merged via the queue into main with commit 18c768a Nov 2, 2024
1 check passed
@willkg willkg deleted the willkg-bug-1928808-badargumenttype branch November 2, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants