add trailing newline in i2pcontrol json response

This commit is contained in:
Anon2025
2025-11-17 13:56:38 +03:00
parent 4c2c06fda8
commit d64030e255
+3 -3
View File
@@ -273,14 +273,14 @@ namespace client
{
response << "{\"id\":" << id << ",\"result\":{";
(this->*(it->second))(pt.get_child ("params"), response);
response << "},\"jsonrpc\":\"2.0\"}";
response << "},\"jsonrpc\":\"2.0\"}\n";
}
else
{
LogPrint (eLogWarning, "I2PControl: Unknown method ", method);
response << "{\"id\":null,\"error\":";
response << "{\"code\":-32601,\"message\":\"Method not found\"},";
response << "\"jsonrpc\":\"2.0\"}";
response << "\"jsonrpc\":\"2.0\"}\n";
}
SendResponse (socket, buf, response, isHtml);
}
@@ -290,7 +290,7 @@ namespace client
std::ostringstream response;
response << "{\"id\":null,\"error\":";
response << "{\"code\":-32700,\"message\":\"" << ex.what () << "\"},";
response << "\"jsonrpc\":\"2.0\"}";
response << "\"jsonrpc\":\"2.0\"}\n";
SendResponse (socket, buf, response, isHtml);
}
catch (...)