Skip to content

Commit b1555de

Browse files
author
ky
committed
fix uri decoding and query string parsing
1 parent e1aad6e commit b1555de

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/network/uri/accessors.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct key_value_sequence
3232
{
3333
query = pair >> *((boost::spirit::qi::lit(';') | '&') >> pair);
3434
pair = key >> -('=' >> value);
35-
key = boost::spirit::qi::char_("a-zA-Z_") >> *boost::spirit::qi::char_("a-zA-Z_0-9/%");
36-
value = +boost::spirit::qi::char_("a-zA-Z_0-9/%");
35+
key = spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("a-zA-Z_0-9/%\\-_~\\.");
36+
value = *spirit::qi::char_("a-zA-Z_0-9/%\\-_~\\.+");
3737
}
3838

3939
boost::spirit::qi::rule<uri::const_iterator, Map()> query;

include/network/uri/decode.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ OutputIterator decode(const InputIterator &in_begin,
7474
*out++ = 0x10 * v0 + v1;
7575
}
7676
else
77+
if (*it == '+')
78+
{
79+
*out++ = ' ';
80+
++ it;
81+
}
82+
else
7783
{
7884
*out++ = *it++;
7985
}

0 commit comments

Comments
 (0)