Merge pull request #7087 from Icinga/feature/http-server-log-user-agent

HttpServerConnection: Log the user agent field for new requests too
This commit is contained in:
Michael Friedrich 2019-04-05 16:00:36 +02:00 committed by GitHub
commit 0640ad3853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -489,7 +489,9 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
Log(LogInformation, "HttpServerConnection") Log(LogInformation, "HttpServerConnection")
<< "Request: " << request.method_string() << ' ' << request.target() << "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.
if (!HandleAccessControl(*m_Stream, request, response, yc)) { if (!HandleAccessControl(*m_Stream, request, response, yc)) {
break; break;