fix: handle literal colons in URL paths for denco router#422
Merged
fredbi merged 2 commits intogo-openapi:masterfrom May 1, 2026
Merged
fix: handle literal colons in URL paths for denco router#422fredbi merged 2 commits intogo-openapi:masterfrom
fredbi merged 2 commits intogo-openapi:masterfrom
Conversation
The denco router uses ':' as a parameter delimiter, but ':' is a valid
character in URL path segments per RFC 3986. Routes like
'/allow/{serverName}/tokenlist:add' were being misinterpreted.
Added escapeLiteralColons() to encode literal ':' as '%3A' before the
router's parameter detection runs. Applied in AddRoute(), Lookup(), and
OtherMethods().
Fixes go-openapi#352
Signed-off-by: KuaaMU <138859253+KuaaMU@users.noreply.github.com>
Signed-off-by: KuaaMU <138859253+KuaaMU@users.noreply.github.com>
fredbi
approved these changes
May 1, 2026
Member
fredbi
left a comment
There was a problem hiding this comment.
Thanks for this addition. Looks good to me.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #422 +/- ##
==========================================
+ Coverage 81.68% 81.69% +0.01%
==========================================
Files 50 50
Lines 3379 3381 +2
==========================================
+ Hits 2760 2762 +2
Misses 507 507
Partials 112 112 ☔ View full report in Codecov by Sentry. |
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.
Summary
Handle literal colons in URL path segments for the denco router.
Motivation
Fixes #352. The denco router uses
:as a parameter delimiter, but:is a valid character in URL path segments per RFC 3986. Routes like/allow/{serverName}/tokenlist:addwere being misinterpreted — the:intokenlist:addwas treated as a parameter prefix.Changes
escapeLiteralColons()function that replaces literal:with%3Ain path segments that aren't parameter delimitersAddRoute(),Lookup(), andOtherMethods()— the three places where paths interact with the denco routerVerification
All tests pass across all 14 packages.