Skip to content

Commit

Permalink
Add the AWS SDK user agent when available
Browse files Browse the repository at this point in the history
This partially reverts the previous behavior
and always adds the AWS SDK user agent when the communication
goes through the SDK, to enrich the user agent string.
  • Loading branch information
Smjert committed Nov 9, 2023
1 parent 425f29a commit cc36f4e
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 @@ -346,10 +346,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 cc36f4e

Please sign in to comment.