forked from cesanta/mongoose
-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
hi
the fix of url regular expression matching doesn't work in this project.
i have tracked the issue & it seems it doesn't work because of:
bool Controller::handles(string method, string url)
{
string key = method + ":" + url;
return (routes.find(key) != routes.end()); // << routes is a map
}
as seen in the code routes is a map & when you try to find a matched url you failed
this function is called before the method:
Response *Controller::process(Request &request)
{
Response *response = NULL;
map<string, RequestHandlerBase *>::iterator it;
for (it=routes.begin(); it!=routes.end(); it++) {
if (request.match(it->first)){
response = it->second->process(request);
break;
}
}
return response;
}
which find a mtach by iterating the map & call request.match
Metadata
Metadata
Assignees
Labels
No labels