Merge pull request #16 from anon998/fix-log-json
Replace invalid characters instead of crashing.
This commit is contained in:
commit
4dd72fc6e4
1 changed files with 2 additions and 1 deletions
|
@ -995,7 +995,8 @@ int main(int argc, char **argv)
|
|||
{ "request", req.body },
|
||||
{ "response", res.body },
|
||||
};
|
||||
fprintf(stdout, "http_request: %s\n", log.dump().c_str());
|
||||
fprintf(stdout, "http_request: %s\n",
|
||||
log.dump(-1, ' ', false, json::error_handler_t::replace).c_str());
|
||||
});
|
||||
|
||||
svr.set_exception_handler([](const Request &, Response &res, std::exception_ptr ep) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue