Incorrect TSR with mixed static and wildcard paths #2918
Closed
Description
The backtracking logic in #2897 is causing incorrect TSR values:
func TestTreeBacktrackingTsr(t *testing.T) {
tree := &node{}
tree.addRoute("/api/:page/:name", fakeHandler("1"))
tree.addRoute("/api/hello/:name/bar/", fakeHandler("1"))
res := tree.getValue("/api/hello/x/bar", getParams(), getSkippedNodes(), false)
if res.tsr != true {
t.Fatalf("expected tsr")
}
}
--- FAIL: TestTreeBacktrackingTsr (0.00s)
tree_test.go:855: expected tsr
I believe the TSR would have to be checked before backtracking.
Metadata
Assignees
Labels
No labels