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:
committed by
Vinnie Falco
parent
55d319a9d9
commit
cd28598e5b
@@ -82,8 +82,8 @@ path_cat(
|
||||
beast::string_view path)
|
||||
{
|
||||
if(base.empty())
|
||||
return path.to_string();
|
||||
std::string result = base.to_string();
|
||||
return std::string(path);
|
||||
std::string result(base);
|
||||
#if BOOST_MSVC
|
||||
char constexpr path_separator = '\\';
|
||||
if(result.back() == path_separator)
|
||||
@@ -122,7 +122,7 @@ handle_request(
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, "text/html");
|
||||
res.keep_alive(req.keep_alive());
|
||||
res.body() = why.to_string();
|
||||
res.body() = std::string(why);
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
};
|
||||
@@ -135,7 +135,7 @@ handle_request(
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, "text/html");
|
||||
res.keep_alive(req.keep_alive());
|
||||
res.body() = "The resource '" + target.to_string() + "' was not found.";
|
||||
res.body() = "The resource '" + std::string(target) + "' was not found.";
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
};
|
||||
@@ -148,7 +148,7 @@ handle_request(
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, "text/html");
|
||||
res.keep_alive(req.keep_alive());
|
||||
res.body() = "An error occurred: '" + what.to_string() + "'";
|
||||
res.body() = "An error occurred: '" + std::string(what) + "'";
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user