diff options
author | ipknHama <ipknhama@gmail.com> | 2014-04-20 17:45:10 +0900 |
---|---|---|
committer | ipknHama <ipknhama@gmail.com> | 2014-04-20 17:45:59 +0900 |
commit | 1173eba33240071a52991f6755623a324742d0b7 (patch) | |
tree | dca3c85e2a2a47c935a52ff70508336b50bb42fe /parser.h | |
parent | 5cdffdf9f75997bfa821203123305b9f8c24b463 (diff) | |
download | crow-1173eba33240071a52991f6755623a324742d0b7.tar.gz crow-1173eba33240071a52991f6755623a324742d0b7.zip |
add support for handlers with request argument, add http method
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2,6 +2,7 @@ #include <string> #include <unordered_map> +#include <boost/algorithm/string.hpp> #include "http_request.h" @@ -35,6 +36,7 @@ namespace flask case 0: if (!self->header_value.empty()) { + boost::algorithm::to_lower(self->header_field); self->headers.emplace(std::move(self->header_field), std::move(self->header_value)); } self->header_field.assign(at, at+length); @@ -66,6 +68,7 @@ namespace flask HTTPParser* self = static_cast<HTTPParser*>(self_); if (!self->header_field.empty()) { + boost::algorithm::to_lower(self->header_field); self->headers.emplace(std::move(self->header_field), std::move(self->header_value)); } return 0; @@ -127,7 +130,7 @@ namespace flask request to_request() { - return request{std::move(url), std::move(headers), std::move(body)}; + return request{(HTTPMethod)method, std::move(url), std::move(headers), std::move(body)}; } std::string url; |