user agent strings in connect logging are now properly quoted

This commit is contained in:
Peter Thorson
2013-04-20 08:56:45 -05:00
parent 91250fcd54
commit d987f7b0d5

View File

@@ -1757,8 +1757,13 @@ void connection<config>::log_open_result()
// User Agent
std::string ua = m_request.get_header("User-Agent");
s << (ua == "" ? "NULL" : ua) << " ";
if (ua == "") {
s << "\"\" ";
} else {
// check if there are any quotes in the user agent
s << "\"" << utility::string_replace_all(ua,"\"","\\\"") << "\" ";
}
// URI
s << (m_uri ? m_uri->get_resource() : "NULL") << " ";