forked from boostorg/beast
Fixes to rfc7230:
fix #1435, fix #1438 * Example and test can be built on msvc v141 15.9.6 using /std:c++17 and BOOST_BEAST_USE_STD_STRING_VIEW. * changed string_view.to_string() to std:string(string_view), awaiting availability of Library Fundamentals TS here. * Reactivated relevant tests to param_list. #ifdef 0 test exhibited same assertion failed error in debug mode. Now fixed in DEBUG on msvc v141 15.9.6 with BOOST_BEAST_USE_STD_STRING_VIEW and /std:c++17. * Looked up http paramters (transfer-encoding, etc.) and changed tests as well as fixing comment to match specs.
This commit is contained in:
1 parent
55d319a9d9
commit
cd28598e5b
24 files changed
+85
-80
No files matched your search
@@ -1152,7 +1152,7 @@ public:
|
||||
"HTTP/1.1 200 OK\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"\r\n"
|
||||
"0" + s.to_string() + "\r\n"
|
||||
"0" + std::string(s) + "\r\n"
|
||||
"\r\n";
|
||||
error_code ec;
|
||||
test_parser<false> p;
|
||||
@@ -1169,7 +1169,7 @@ public:
|
||||
"HTTP/1.1 200 OK\r\n"
|
||||
"Transfer-Encoding: chunked\r\n"
|
||||
"\r\n"
|
||||
"0" + s.to_string() + "\r\n"
|
||||
"0" + std::string(s) + "\r\n"
|
||||
"\r\n";
|
||||
error_code ec;
|
||||
test_parser<false> p;
|
||||
|
||||
@@ -195,11 +195,11 @@ public:
|
||||
std::string s;
|
||||
for(auto const& v : ce)
|
||||
{
|
||||
s.append(v.first.to_string());
|
||||
s.append(std::string(v.first));
|
||||
s.push_back(',');
|
||||
if(! v.second.empty())
|
||||
{
|
||||
s.append(v.second.to_string());
|
||||
s.append(std::string(v.second));
|
||||
s.push_back(',');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
bool get_keep_alive_impl(unsigned) const { return true; }
|
||||
bool has_content_length_impl() const { return false; }
|
||||
void set_method_impl(string_view) {}
|
||||
void set_target_impl(string_view s) { target = s.to_string(); }
|
||||
void set_target_impl(string_view s) { target = std::string(s); }
|
||||
void set_reason_impl(string_view) {}
|
||||
void set_chunked_impl(bool) {}
|
||||
void set_content_length_impl(boost::optional<std::uint64_t>) {}
|
||||
|
||||
@@ -88,6 +88,9 @@ public:
|
||||
cq("\t; \t xyz=1 ; ijk=\"q\\\"t\"", ";xyz=1;ijk=q\"t");
|
||||
ce(";x;y");
|
||||
|
||||
ce(";chunked;a=b;i=j;gzip;windowBits=12");
|
||||
ce(";chunked;a=b;i=j;gzip;windowBits=12;permessage-deflate");
|
||||
|
||||
// invalid strings
|
||||
cs(";", "");
|
||||
cs(";,", "");
|
||||
@@ -96,6 +99,7 @@ public:
|
||||
cq(";xy=\"\x7f", "");
|
||||
cq(";xy=\"\\", "");
|
||||
cq(";xy=\"\\\x01\"", "");
|
||||
|
||||
}
|
||||
|
||||
static
|
||||
@@ -344,11 +348,9 @@ public:
|
||||
run()
|
||||
{
|
||||
testOptTokenList();
|
||||
#if 0
|
||||
testParamList();
|
||||
testExtList();
|
||||
testTokenList();
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
fc_->fail(ec);
|
||||
else
|
||||
ec = {};
|
||||
fields[name.to_string()] = value.to_string();
|
||||
fields[std::string(name)] = std::string(value);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
write(ts, m, ec);
|
||||
if(ec && ec != error::end_of_stream)
|
||||
BOOST_THROW_EXCEPTION(system_error{ec});
|
||||
return tr.str().to_string();
|
||||
return std::string(tr.str());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in new issue
Block a user