Skip to content

Fix/preserve query string encoding#41

Merged
joshpollara merged 6 commits intomainfrom
fix/preserve-query-string-encoding
Sep 22, 2025
Merged

Fix/preserve query string encoding#41
joshpollara merged 6 commits intomainfrom
fix/preserve-query-string-encoding

Conversation

@joshpollara
Copy link
Copy Markdown
Contributor

No description provided.

joshpollara and others added 2 commits September 19, 2025 20:11
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Previously, Terratunnel was double-encoding query parameters, converting commas
to %2C. This fix preserves the raw query string from the server and uses it
directly in the client, avoiding re-encoding by httpx.

- Server now includes raw_query_string in request data
- Client uses raw query string when available (no re-encoding)
- Maintains backward compatibility for older servers

Fixes issue where URLs like ?page=n,malcolm-demo were becoming ?page=n%2Cmalcolm-demo

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@joshpollara joshpollara requested a review from a team as a code owner September 19, 2025 18:17
- Support list query parameters using repeated keys (e.g., page=n&page=malcolm-demo)
- Preserve exact query string encoding (e.g., %3D for equals, %2C for comma)
- Fix logging to show encoded query strings, not decoded values
- Both features work together seamlessly
- Maintains full backward compatibility

Server changes:
- Use list(request.query_params.multi_items()) for list param support
- Capture raw_query_string for encoding preservation

Client changes:
- Use raw_query_string when available to preserve encoding
- Handle both dict and list of tuples formats for query_params
- Update logging to show encoded values
@joshpollara joshpollara merged commit be0afe9 into main Sep 22, 2025
2 checks passed
@joshpollara joshpollara deleted the fix/preserve-query-string-encoding branch September 22, 2025 11:00
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