Repository navigation
fix(client): percent-encode task and config ids in REST paths - #450
Merged
muscariello merged 1 commit intoNov 2, 2026
Merged
muscariello merged 1 commit into
muscariello merged 1 commit into
Conversation
This was referenced Nov 1, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
muscariello
force-pushed
the
stack/11-rest-client-path-encoding
branch
from
November 2, 2026 12:00
66316c1 to
c30413d
Compare
muscariello
force-pushed
the
stack/11-rest-client-path-encoding
branch
from
November 2, 2026 12:02
c30413d to
87c2e79
Compare
The REST transport put `req.id` and `req.task_id` into the URL path as they were, so `/`, `?`, `#` and `%` in an id changed the request: the id `../admin?x=1` requested `/a2a/admin?x=1`, and `#` cut `:cancel` off into the fragment. Every id is now one path segment with everything but the RFC 3986 unreserved characters percent-encoded. Signed-off-by: gulldan <[email protected]>
muscariello
force-pushed
the
stack/11-rest-client-path-encoding
branch
from
November 2, 2026 14:28
87c2e79 to
999087e
Compare
msardara
approved these changes
Nov 2, 2026
Merged
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.
Fixes #423. Replaces #424. Stacked on #449: review only the last commit.
Cause:
RestTransportput task and config ids into the URL path unescaped, so/,?,#and%in an id changed the request. The id../admin?x=1against basehttp://host/a2arequested/a2a/admin?x=1, and a#cut:canceloff into the fragment. RFC 3986 §3.3 requires reserved characters in a path segment to be percent-encoded.Fix: a
segmenthelper percent-encodes an id, keeping only the RFC 3986 unreserved characters, and is applied to the seven task and push-config paths. Ids made of unreserved characters, such as every UUID, give the same URLs as before.Dependency: adds
percent-encoding = "2"toa2a-client. The lockfile change is a single dependency edge, sincepercent-encoding2.3.2 is already inCargo.lockas a transitive dependency.Tests: a local listener records the request line for
get_task("../admin?x=1")andcancel_task("t#1 %")and expects the encoded paths.Unproven: the failure without the encoding was not run locally. CI is the check.