Closed membphis closed 5 years ago
This is a mini test case, it should be a bug, I think it should match all current routing rules.
Do you agree with this? @c9s
R3Node * tree = r3_tree_create(3); int route_data1 = 1; int route_data2 = 2; // insert the R3Route path into the router tree r3_tree_insert_routel(tree, METHOD_GET | METHOD_POST, "/api", sizeof("/api") - 1, &route_data1 ); r3_tree_insert_routel(tree, METHOD_GET | METHOD_POST, "/api/v1", sizeof("/api/v1") - 1, &route_data2 ); char *errstr = NULL; int err = r3_tree_compile(tree, &errstr); if(err) { printf("%s\n",errstr); free(errstr); return 1; } char *path = "/api/v1/user"; match_entry *e = match_entry_createl(path, strlen(path)); R3Node *n; R3Route *r; n = r3_tree_matchl(tree, e->path.base, e->path.len, e); if (n == NULL) { printf("failed to match\n"); return 1; } ...
$ gcc -g test.c -lr3 && LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./a.out failed to match
that is not a bug, close it.
This is a mini test case, it should be a bug, I think it should match all current routing rules.
Do you agree with this? @c9s