diff options
author | Antony Woods <acron1@gmail.com> | 2014-10-24 09:40:09 +0100 |
---|---|---|
committer | Antony Woods <acron1@gmail.com> | 2014-10-24 09:40:09 +0100 |
commit | 693aac108de4dc62811b9a2737d895ada474cfb2 (patch) | |
tree | 44cc722afea8b6ef26095cd27aa64b97ec48d74e /include/routing.h | |
parent | 27bf11d35c8ce44fd9fef656e2975712846b9bb2 (diff) | |
parent | 4b3b8070e75ce0fc181e5c012c47da2a1e7a918e (diff) | |
download | crow-693aac108de4dc62811b9a2737d895ada474cfb2.tar.gz crow-693aac108de4dc62811b9a2737d895ada474cfb2.zip |
Post-pull commit
Diffstat (limited to 'include/routing.h')
-rw-r--r-- | include/routing.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/routing.h b/include/routing.h index e62cbce..9f607f1 100644 --- a/include/routing.h +++ b/include/routing.h @@ -6,6 +6,7 @@ #include <unordered_map> #include <memory> #include <boost/lexical_cast.hpp> +#include <vector> #include "common.h" #include "http_response.h" @@ -629,16 +630,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 +647,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; |