Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix uri decoding and query string parsing
  • Loading branch information
ky committed Oct 30, 2012
commit b1555de21cf5c660b9b23e56fc9ab793071b2a9f
4 changes: 2 additions & 2 deletions include/network/uri/accessors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ struct key_value_sequence
{
query = pair >> *((boost::spirit::qi::lit(';') | '&') >> pair);
pair = key >> -('=' >> value);
key = boost::spirit::qi::char_("a-zA-Z_") >> *boost::spirit::qi::char_("a-zA-Z_0-9/%");
value = +boost::spirit::qi::char_("a-zA-Z_0-9/%");
key = spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9/%\\-_~\\.");
value = *spirit::qi::char_("a-zA-Z_0-9/%\\-_~\\.+");
}

boost::spirit::qi::rule<uri::const_iterator, Map()> query;
Expand Down
6 changes: 6 additions & 0 deletions include/network/uri/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ OutputIterator decode(const InputIterator &in_begin,
*out++ = 0x10 * v0 + v1;
}
else
if (*it == '+')
{
*out++ = ' ';
++ it;
}
else
{
*out++ = *it++;
}
Expand Down