Skip to content

Commit

Permalink
Add AWS SDK user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Smjert committed Oct 26, 2023
1 parent 6629ae1 commit dd9c1ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions osquery/utils/aws/aws_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ std::shared_ptr<Aws::Http::HttpResponse> OsqueryHttpClient::MakeRequest(
http::Request req(url);

for (const auto& requestHeader : request.GetHeaders()) {
/* We don't want to set the AWS SDK user agent, lets skip it
and let the HTTP client use its default */
if (!boost::iequals(requestHeader.first, "User-Agent")) {
req << http::Request::Header(requestHeader.first, requestHeader.second);
// Prepend the osquery user agent to the AWS SDK agent
if (boost::iequals(requestHeader.first, "User-Agent")) {
req << http::Request::Header(
requestHeader.first,
FLAGS_http_user_agent + " " + requestHeader.second);
}
}

Expand Down

0 comments on commit dd9c1ab

Please sign in to comment.