Preserve encoded query parameters in recorded requests - #330
Conversation
|
Hi @bensynapse, ideally you should have opened an issue first. Could you please do that and link this PR as the fix for it? |
|
I switched the new tests in tests/test_http.py to requests and kept the encoded parameter cases. |
|
I renamed it to test_request_querystring_uses_form_urlencoded_semantics in 60ffc9f. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #330 +/- ##
=======================================
Coverage 98.85% 98.85%
=======================================
Files 22 22
Lines 1224 1224
=======================================
Hits 1210 1210
Misses 14 14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



I run Live Tennis API.
A recorded request with q=a%2Bb%26c reports two fields, q="a b" and c="". It should report q="a+b&c".
Request.querystring now passes the raw query to parse_qs, which decodes each field once. This also preserves encoded parameter names and literal percent escapes.
The fourteen new cases use requests. They cover encoded parameters, repeated and empty values, and recorded HTTP and HTTPS requests. Eight regressions fail before the fix.
Docker make test passes 252 tests and the separate pook test. Two tests are expected failures, and one is an expected failure that passes.
make safetest passes 232 tests on Python 3.14. make types and the changed file's pre-commit hooks pass.
Existing response close and dependency warnings remain.
Fixes #331.