Skip to content

Fix query_param_matcher not matching empty query parameter values#787

Merged
markstory merged 1 commit intogetsentry:masterfrom
worksbyfriday:fix-empty-query-params
Feb 18, 2026
Merged

Fix query_param_matcher not matching empty query parameter values#787
markstory merged 1 commit intogetsentry:masterfrom
worksbyfriday:fix-empty-query-params

Conversation

@worksbyfriday
Copy link
Contributor

Summary

_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 the request.

The fix adds keep_blank_values=True to the parse_qsl call so that empty-valued parameters are preserved.

Test plan

  • Added test_query_param_matcher_empty_value — verifies that query_param_matcher({"bar": ""}) matches a request to ?bar=
  • All 38 existing matchers tests pass (no regressions)

Fixes #778

_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 markstory merged commit 0905cb8 into getsentry:master Feb 18, 2026
20 checks passed
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.90%. Comparing base (32c4884) to head (3ca0ee7).
⚠️ Report is 26 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@markstory
Copy link
Member

Thank you 🎉

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.

Cannot match empty query parameters

2 participants