-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect TSR with mixed static and wildcard paths #2918
Comments
Also, I don't know why this unrelated change was made in #2767: - value.tsr = (path == "/") ||
- (len(prefix) == len(path)+1 && prefix[len(path)] == '/' &&
- path == prefix[:len(prefix)-1] && n.handlers != nil)
+ value.tsr = path == "/" ||
+ (len(prefix) == len(path)+1 && n.handlers != nil) It is causing simple tests to fail: func TestTreeTsr(t *testing.T) {
tree := &node{}
tree.addRoute("/foo", fakeHandler("1"))
tree.addRoute("/bar/", fakeHandler("1"))
res := tree.getValue("/baz", getParams(), getSkippedNodes(), false)
if res.tsr != false {
t.Fatalf("unexpected tsr")
}
}
|
I have this fixed locally, I'll submit a PR. |
Great works, waiting for it. |
Thanks for your work, waiting for it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The backtracking logic in #2897 is causing incorrect TSR values:
I believe the TSR would have to be checked before backtracking.
The text was updated successfully, but these errors were encountered: