void SendHTTPError(unsigned int response, const char* errstr = NULL)
{
+ if (!errstr)
+ errstr = http_status_str((http_status)response);
+
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Sending HTTP error %u: %s", response, errstr);
static HTTPHeaders empty;
std::string data = InspIRCd::Format(
"<html><head></head><body style='font-family: sans-serif; text-align: center'>"
"<h1 style='font-size: 48pt'>Error %u</h1><h2 style='font-size: 24pt'>%s</h2><hr>"
"<small>Powered by <a href='https://www.inspircd.org'>InspIRCd</a></small></body></html>",
- response, errstr ? errstr : http_status_str((http_status)response));
+ response, errstr);
Page(data, response, &empty);
}
if ((request.GetPath() != "/config") && (request.GetPath() != "/config/"))
return MOD_RES_PASSTHRU;
- ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling request for the HTTP /config route");
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", request.GetPath().c_str());
std::stringstream buffer;
ConfigDataHash& config = ServerInstance->Config->config_data;
if (path[path.size() - 1] == '/')
path.erase(path.size() - 1, 1);
- ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling httpd event");
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", http->GetPath().c_str());
bool found = true;
std::stringstream data;