hide debug here (m_debug/m_verbose should be adhered to in classes as they *optionally* enable debug trace for modules, allowing the LogLevel to be set to 1 and not spam the log/console with unintended debug statements); alter bad handling of a compiler constant string for the Server/User-Agent strings;

pull/51/head
Bryan Biedenkapp 2 years ago
parent 1e8a842a30
commit ba785f3d91

@ -409,10 +409,10 @@ void HTTPPayload::ensureDefaultHeaders(const std::string& contentType)
if (!isClientPayload) {
headers.add("Content-Type", std::string(contentType));
headers.add("Content-Length", std::to_string(content.size()));
headers.add("Server", std::string((__EXE_NAME__ "/" __VER__)));
headers.add("Server", std::string(("DVM/" __VER__)));
}
else {
headers.add("User-Agent", std::string((__EXE_NAME__ "/" __VER__)));
headers.add("User-Agent", std::string(("DVM/" __VER__)));
headers.add("Accept", "*/*");
if (::strtoupper(method) != HTTP_GET) {
headers.add("Content-Type", std::string(contentType));

@ -709,7 +709,10 @@ void RESTAPI::restAPI_GetPeerQuery(const HTTPPayload& request, HTTPPayload& repl
uint32_t peerId = entry.first;
network::FNEPeerConnection* peer = entry.second;
if (peer != nullptr) {
LogDebug(LOG_REST, "Preparing Peer %u (%s) for REST API query", peerId, peer->address().c_str());
if (m_debug) {
LogDebug(LOG_REST, "Preparing Peer %u (%s) for REST API query", peerId, peer->address().c_str());
}
json::object peerObj = json::object();
peerObj["peerId"].set<uint32_t>(peerId);

Loading…
Cancel
Save

Powered by TurnKey Linux.