aboutsummaryrefslogtreecommitdiffstats
path: root/include/routing.h
diff options
context:
space:
mode:
authoripkn <ipknhama@gmail.com>2014-10-23 23:44:31 +0900
committeripkn <ipknhama@gmail.com>2014-10-23 23:44:31 +0900
commit4965d495a7ada4fb7c6aeed1fd6c4b5830bb99a9 (patch)
treea65f112b1df3035807c3b5dfab9aca86d86d1d1e /include/routing.h
parenta5fab23f70e6e33c633ba4b646a41d0851169ad1 (diff)
parentada303970732f00e2d3017b726effad65d27a4d2 (diff)
downloadcrow-4965d495a7ada4fb7c6aeed1fd6c4b5830bb99a9.tar.gz
crow-4965d495a7ada4fb7c6aeed1fd6c4b5830bb99a9.zip
Merge pull request #28 from acron0/url-params-in-req
Added URL params (request.url_params)
Diffstat (limited to 'include/routing.h')
-rw-r--r--include/routing.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/routing.h b/include/routing.h
index e62cbce..87d492b 100644
--- a/include/routing.h
+++ b/include/routing.h
@@ -629,16 +629,13 @@ public:
void handle(const request& req, response& res)
{
- // remove url params
- auto editedUrl = req.url.substr(0, req.url.find("?"));
-
- auto found = trie_.find(editedUrl);
+ auto found = trie_.find(req.url);
unsigned rule_index = found.first;
if (!rule_index)
{
- CROW_LOG_DEBUG << "Cannot match rules " << editedUrl;
+ CROW_LOG_DEBUG << "Cannot match rules " << req.url;
res = response(404);
res.end();
return;
@@ -649,7 +646,7 @@ public:
if ((rules_[rule_index]->methods() & (1<<(uint32_t)req.method)) == 0)
{
- CROW_LOG_DEBUG << "Rule found but method mismatch: " << editedUrl << " with " << method_name(req.method) << "(" << (uint32_t)req.method << ") / " << rules_[rule_index]->methods();
+ CROW_LOG_DEBUG << "Rule found but method mismatch: " << req.url << " with " << method_name(req.method) << "(" << (uint32_t)req.method << ") / " << rules_[rule_index]->methods();
res = response(404);
res.end();
return;