|
@@ -1249,8 +1249,13 @@ TEST(ExceptionHandlerTest, ContentLength) {
|
|
|
Server svr;
|
|
Server svr;
|
|
|
|
|
|
|
|
svr.set_exception_handler([](const Request & /*req*/, Response &res,
|
|
svr.set_exception_handler([](const Request & /*req*/, Response &res,
|
|
|
- std::exception &e) {
|
|
|
|
|
- EXPECT_EQ("abc", std::string(e.what()));
|
|
|
|
|
|
|
+ std::exception_ptr ep) {
|
|
|
|
|
+ EXPECT_FALSE(ep == nullptr);
|
|
|
|
|
+ try{
|
|
|
|
|
+ std::rethrow_exception(ep);
|
|
|
|
|
+ }catch(std::exception& e){
|
|
|
|
|
+ EXPECT_EQ("abc", std::string(e.what()));
|
|
|
|
|
+ }
|
|
|
res.status = 500;
|
|
res.status = 500;
|
|
|
res.set_content("abcdefghijklmnopqrstuvwxyz",
|
|
res.set_content("abcdefghijklmnopqrstuvwxyz",
|
|
|
"text/html"); // <= Content-Length still 13 at this point
|
|
"text/html"); // <= Content-Length still 13 at this point
|