diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-01-02 13:41:29 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-01-02 13:41:29 +0100 |
commit | 3a4010028fc7d310c841c3d96d69008ce7d6c288 (patch) | |
tree | 91091cfed67e138804bf4c317cb4fbec3995228e | |
parent | 77b0a5908e0871b1d3b8aae7b5a8cd241dff9d63 (diff) |
Urldecode path.
-rw-r--r-- | http_connection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/http_connection.cpp b/http_connection.cpp index 0873985..79556e7 100644 --- a/http_connection.cpp +++ b/http_connection.cpp @@ -71,7 +71,9 @@ bool HTTP::Connection::parse_request(boost::asio::streambuf& buf) { qi::rule<Iterator, std::string()> word_p = +(qi::char_ - ' ' - '\r'); - qi::rule<Iterator, std::vector<std::string>()> path_p = '/' >> +(qi::char_ - '/' - '?' - ' ') % '/'; + qi::rule<Iterator, char()> urlchar_p = (qi::char_ - '%') | ('%' >> qi::uint_parser<char, 16, 2, 2>()); + + qi::rule<Iterator, std::vector<std::string>()> path_p = '/' >> +(urlchar_p - '/' - '?' - ' ') % '/'; qi::rule<Iterator, std::pair<std::string, std::string>()> pair_p = +(qi::char_ - '=') >> '=' >> +(qi::char_ - '&' - ' '); qi::rule<Iterator, std::map<std::string, std::string>()> args_p = '?' >> pair_p >> *('&' >> pair_p); |