Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue #161#163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
glynos merged 4 commits intocpp-netlib:masterfrommaxim-ky:master
Dec 8, 2012
Merged
Show file tree
Hide file tree
Changes fromall commits
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
2 changes: 2 additions & 0 deletionsinclude/network/protocol/http/message/header.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,7 @@ namespace network {
namespace http {

struct request_header {
typedef std::string string_type;
std::string name, value;
};

Expand All@@ -33,6 +34,7 @@ inline void swap(request_header & l, request_header & r) {
}

struct response_header {
typedef std::string string_type;
std::string name, value;
};

Expand Down
4 changes: 2 additions & 2 deletionsinclude/network/uri/accessors.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff 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 = 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/%");
}

boost::spirit::qi::rule<uri::const_iterator, Map()> query;
Expand Down
6 changes: 6 additions & 0 deletionsinclude/network/uri/decode.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff 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
14 changes: 14 additions & 0 deletionslibs/network/test/uri/uri_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -691,3 +691,17 @@ BOOST_AUTO_TEST_CASE(uri_unordered_set_test) {
BOOST_REQUIRE(!uri_set.empty());
BOOST_CHECK_EQUAL((*uri_set.begin()), network::uri("http://www.example.com/"));
}

BOOST_AUTO_TEST_CASE(issue_161_test) {
network::uri instance("http://www.example.com/path?param1=-&param2=some+plus+encoded+text&param3=~");
BOOST_REQUIRE(network::valid(instance));

std::map<std::string, std::string> queries;
network::query_map(instance, queries);
BOOST_REQUIRE_EQUAL(queries.size(), std::size_t(3));
BOOST_CHECK_EQUAL(queries["param1"], "-");
BOOST_CHECK_EQUAL(queries["param2"], "some+plus+encoded+text");
BOOST_CHECK_EQUAL(queries["param3"], "~");
BOOST_CHECK_EQUAL(network::decoded(queries["param2"]), "some plus encoded text");
}


[8]ページ先頭

©2009-2025 Movatter.jp