implemented 501 error
~8 min work cause I just missed an if statement
This commit is contained in:
parent
2444a071ac
commit
966373e629
@ -39,16 +39,18 @@ public class Router {
|
|||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
System.out.println(routeComponents[i]);
|
System.out.println(routeComponents[i]);
|
||||||
for (String search = routeComponents[i]; component.service == null; component = this.routeMap.get(method).get(search = String.join("/", search, routeComponents[++i]))) {
|
for (String search = routeComponents[i]; component != null && component.service == null; component = this.routeMap.get(method).get(search = String.join("/", search, routeComponents[++i]))) {
|
||||||
System.out.println(String.join("/", search, routeComponents[i+1]));
|
System.out.println(component);
|
||||||
if (component.hasPathVariable) {
|
if (component.hasPathVariable) {
|
||||||
pathVariable = routeComponents[++i];
|
pathVariable = routeComponents[++i];
|
||||||
search = String.join("/", search, "{var}");
|
search = String.join("/", search, "{var}");
|
||||||
System.out.println(search + " - " + routeComponents[i+1]);
|
|
||||||
System.out.println(this.routeMap.get(HttpMethod.GET).containsKey("test/{var}"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (component == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
component.service.setPathVariable(pathVariable);
|
component.service.setPathVariable(pathVariable);
|
||||||
return component.service;
|
return component.service;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user