Skip to content

Reset captured path params for each candidate route in local mode - #2196

Open
kwy404 wants to merge 1 commit into
aws:masterfrom
kwy404:fix-route-matcher-stale-params
Open

kwy404 wants to merge 1 commit into
aws:masterfrom
kwy404:fix-route-matcher-stale-params

Conversation

@kwy404

@kwy404 kwy404 commented Sep 24, 2026

Copy link
Copy Markdown

Issue #, if available:

Description of changes:

RouteMatcher.match_route shared one captured dict across every candidate route with the same number of path segments. When an earlier route matched the placeholders but failed on a literal segment, its params stayed in the dict, so with routes /{x}/c and /{y}/d, a request to /foo/d was matched with {'x': 'foo', 'y': 'foo'} in local mode. The dict is now reset for each candidate route, and a unit test covers this case.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kwy404
kwy404 requested a review from a team as a code owner September 24, 2026 07:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant