Repository navigation
Conversation
Go's URL parser rejects query pairs containing an unencoded semicolon, and ReverseProxy removes them from the outbound request. Clients that send values like ?a=1;2 lose the whole parameter without any error. When ENCODE_QUERY_SEMICOLONS is enabled, raw semicolons are encoded as %3B before caching and proxying, so they are passed upstream as part of the value and requests with different values get distinct cache keys.
There was a problem hiding this comment.
Copilot review overview
🟢 Approved
The implementation is scoped, correctly ordered in the handler stack, documented, and adequately tested.
Review effort: Balanced
Findings: None
What changed in this PR
Adds opt-in preservation of raw query-string semicolons before caching and proxying.
Changes:
- Adds the
ENCODE_QUERY_SEMICOLONSconfiguration option. - Encodes raw semicolons as
%3Bbefore cache lookup and proxying. - Tests encoding, disabled behavior, configuration, and cache-key handling.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
README.md |
Documents the new environment variable. |
internal/service.go |
Passes configuration into the handler stack. |
internal/query_semicolon_handler.go |
Implements opt-in semicolon encoding. |
internal/query_semicolon_handler_test.go |
Tests proxy and cache behavior. |
internal/handler.go |
Places encoding before caching and proxying. |
internal/config.go |
Loads the new configuration option. |
internal/config_test.go |
Tests default and overridden configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Go's URL parser rejects query pairs containing an unencoded semicolon, and ReverseProxy removes them from the outbound request. Clients that send values like
?a=1;2lose the whole parameter without any error (!!!). This was really surprising, and I discovered it accidentally/unfortunately when moving a Rails app to thruster.I am aware that it's normal/preferred for clients to encode semicolons in the request url, but it was only when switching to thruster that not doing that became impossible.
This PR introduces a config option to help out. When
ENCODE_QUERY_SEMICOLONSis enabled, raw semicolons are encoded as%3Bbefore caching and proxying, so they are passed upstream (eg Rails) as part of the value and requests with different values get distinct cache keys.Related discussions