Repository navigation
fix(httpapi): percent-decode the registry {id} on search, refresh, edit and remove - #1774
Merged
Dumbris merged 1 commit intoOct 26, 2026
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…it and remove
A custom registry id is user-chosen (add-source --id) and may contain
characters the CLI (url.PathEscape) and Web UI (encodeURIComponent)
percent-encode, such as ':' or '/'. chi routes on RawPath, so the {id}
param arrived encoded and the exact-match lookup missed: the registry
could be added but not searched, refreshed, edited or removed.
handleAddFromRegistry already decodes; apply the same decodePathParam
in the other four registry handlers.
rudycelekli
force-pushed
the
fix/registry-path-param-decode-20261024-01
branch
from
October 24, 2026 22:18
dc0728c to
3a908d2
Compare
Dumbris
approved these changes
Oct 26, 2026
Dumbris
left a comment
Member
There was a problem hiding this comment.
Verified: the PR test fails on main for the reason described and passes on this branch merged with main; race tests for the touched packages and CI lint (bare and server tags) are clean. Also built and tested together with the rest of this batch, independently reviewed, and cross-reviewed with a second model.
Member
|
Merged. Thank you, @rudycelekli! Custom registries with ids like |
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.
Problem
Custom registry ids are user-chosen (
registry add-source --id ...) and aren't restricted to a slug, so they can contain characters such as:or/. The CLI builds these URLs withurl.PathEscapeand the Web UI withencodeURIComponent, so those characters reach the server percent-encoded. chi routes onRawPath, which meanschi.URLParam(r, "id")returns the encoded form (acme%3Ainternal) and the exact-match registry lookup misses.As a result, a registry added as
acme:internalcan't be searched, refreshed, edited or removed.handleAddFromRegistryalready decodes the same param (MCP-1056); the other four handlers don't.Fix
Wrap
{id}in the existingdecodePathParaminhandleSearchRegistryServers,handleRefreshRegistryCache,handleEditRegistrySourceandhandleRemoveRegistrySource.Test
TestRegistryRoutes_DecodeIDParamsendsacme%3Ainternalto all four routes and checks the id passed to the controller. On main all four subtests receiveacme%3Ainternal; with this change they receiveacme:internal.go test -count=1 ./internal/httpapi/passes.Made with Cursor