Fix query_param_matcher not matching empty query parameter values#787
Merged
markstory merged 1 commit intogetsentry:masterfrom Feb 18, 2026
Merged
Conversation
_parse_request_params calls parse_qsl without keep_blank_values=True,
so query parameters with empty string values (e.g. ?bar=) are silently
dropped. This causes query_param_matcher({"bar": ""}) to never match.
Fixes getsentry#778
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
markstory
approved these changes
Feb 18, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #787 +/- ##
==========================================
+ Coverage 99.84% 99.90% +0.06%
==========================================
Files 9 9
Lines 3166 3190 +24
==========================================
+ Hits 3161 3187 +26
+ Misses 5 3 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Thank you 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_parse_request_paramscallsparse_qslwithoutkeep_blank_values=True, so query parameters with empty string values (e.g.?bar=) are silently dropped. This causesquery_param_matcher({"bar": ""})to never match the request.The fix adds
keep_blank_values=Trueto theparse_qslcall so that empty-valued parameters are preserved.Test plan
test_query_param_matcher_empty_value— verifies thatquery_param_matcher({"bar": ""})matches a request to?bar=Fixes #778