Skip to content

Conversation

@rbygrave
Copy link
Contributor

@rbygrave rbygrave commented Dec 2, 2024

…p as LinkedHashMap

The RouteIndexBuild.Entry.pathMap needs to preserve ordering of the routes. The order that they are added/registered must be preserved. This is the precedence of route matching where the first match wins (literal paths should match first etc).

…p as LinkedHashMap

The RouteIndexBuild.Entry.pathMap needs to preserve ordering of the routes. The order that they are added/registered must be preserved. This is the precedence of route matching where the first match wins (literal paths should match first etc).

private final List<SpiRoutes.Entry> list = new ArrayList<>();
private final Map<String,List<SpiRoutes.Entry>> pathMap = new HashMap<>();
private final Map<String,List<SpiRoutes.Entry>> pathMap = new LinkedHashMap<>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bug fix here - LinkedHashMap required.

@rbygrave rbygrave requested a review from SentryMan December 2, 2024 08:51
@rbygrave rbygrave self-assigned this Dec 2, 2024
@rbygrave rbygrave merged commit 480e737 into master Dec 2, 2024
7 checks passed
@rbygrave rbygrave deleted the fix/path-ordering branch December 2, 2024 08:51
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.

2 participants