Skip to content

Commit

Permalink
Fix for issue 130 (#131)
Browse files Browse the repository at this point in the history
* Failure test case for issue #130

* Use the wildcard to match the uri if the uri match returns null
Fix for issue #130
  • Loading branch information
ajay-gov authored Sep 16, 2023
1 parent 2ccb764 commit 4e9886a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ T get(UriPath path, UriQuery query, UriFragment fragment) {
if (mapping == null) {
mapping = this.wildcard;
}
return mapping.get(path.tail(), query, fragment);
final T result = mapping.get(path.tail(), query, fragment);
return result != null ? result : this.wildcard.get(path.tail(), query, fragment);
} else {
return this.terminal.get(query, fragment);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public void mapMultipleUriAndUriVariablePaths() {

assertEquals(mapper.get("/a/x"), "AX");
assertEquals(mapper.get("/a/b/c/d"), "ABCD");
assertEquals(mapper.get("/a/x/c/d"), "ABCD");
}

@Test
Expand Down

0 comments on commit 4e9886a

Please sign in to comment.