Skip to content

Commit

Permalink
Print user agnet to log
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Jul 13, 2024
1 parent af225cc commit 8b47fc9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proxy/include/proxy/proxy_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3973,6 +3973,10 @@ R"x*x*x(<html>
std::ios_base::binary |
std::ios_base::in);

std::string user_agent;
if (request.count(http::field::user_agent))
user_agent = std::string(request[http::field::user_agent]);

XLOG_DBG << "connection id: "
<< m_connection_id
<< ", http file: "
Expand All @@ -3981,6 +3985,9 @@ R"x*x*x(<html>
<< content_length
<< (request.count("Range") ?
", range: " + std::string(request["Range"])
: std::string())
<< (!user_agent.empty() ?
", user_agent: " + user_agent
: std::string());

http::status st = http::status::ok;
Expand Down

0 comments on commit 8b47fc9

Please sign in to comment.