mirror of https://github.com/Icinga/icinga2.git
parent
e9b8fc234b
commit
29e5d7def7
|
@ -539,12 +539,16 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
|
||||||
authenticatedUser = ApiUser::GetByAuthHeader(request[http::field::authorization].to_string());
|
authenticatedUser = ApiUser::GetByAuthHeader(request[http::field::authorization].to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "HttpServerConnection")
|
Log logMsg (LogInformation, "HttpServerConnection");
|
||||||
<< "Request: " << request.method_string() << ' ' << request.target()
|
|
||||||
|
logMsg << "Request: " << request.method_string() << ' ' << request.target()
|
||||||
<< " (from " << m_PeerAddress
|
<< " (from " << m_PeerAddress
|
||||||
<< "), user: " << (authenticatedUser ? authenticatedUser->GetName() : "<unauthenticated>")
|
<< "), user: " << (authenticatedUser ? authenticatedUser->GetName() : "<unauthenticated>")
|
||||||
<< ", agent: " << request[http::field::user_agent] << ")."; //operator[] - Returns the value for a field, or "" if it does not exist.
|
<< ", agent: " << request[http::field::user_agent]; //operator[] - Returns the value for a field, or "" if it does not exist.
|
||||||
|
|
||||||
|
Defer addRespCode ([&response, &logMsg]() {
|
||||||
|
logMsg << ", status: " << response.result() << ").";
|
||||||
|
});
|
||||||
|
|
||||||
if (!HandleAccessControl(*m_Stream, request, response, yc)) {
|
if (!HandleAccessControl(*m_Stream, request, response, yc)) {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue