You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PathSegmentTemplateMatcher accepts conflicting captures for repeated variable names #1217
PathSegmentTemplateMatcher accepts conflicting values for a repeated variable name and retains only the last capture. A resource request can therefore match a template whose repeated variable cannot explain the request consistently.
This was identified by @chrikrah in the review of #1175. This issue tracks the matching behavior separately from #1084's depth-check allocation fix.
Actual: the URI matches with variables = {id=43}; the first capture is overwritten and the check fails. The same template with 42/42 matches consistently and should keep doing so.
Expected: reject a match when a repeated name captures different values, using the matcher's existing one-pass percent-decoding semantics. Keep consistent repeated captures, distinct names, scoring, URI normalization and depth limits unchanged.
Version check
The same six tests against the latest release tag 0.16.0 (4c55826) have three failures and three passing controls. The inconsistent repeated captures are accepted there too.
Candidate and local validation
A local candidate checks an existing capture before overwriting it. Six tests cover differing captures, equal captures and their score, decoded equality, a differing third occurrence, independent names and one-pass decoding.
On reviewed head 0f6a84c, three of those six cases fail without the candidate. With it, all 278 core JVM tests and nine ServerResourceTemplateTest integration tests pass. Core ktlint, Kotlin ABI and diff checks pass. These are local results on macOS arm64 with Temurin 21; JS, Native and Wasm runtime tests and detekt were not run for this candidate.
The existing #1175 branch remains unchanged. This candidate intentionally rejects some previously accepted URIs, so a separate follow-up keeps that behavior change reviewable without expanding the allocation PR. No production impact or full multiplatform validation is claimed.
Activity