Skip to content

Commit 29614f4

Browse files
committed
Only append if we have credential features
1 parent bb7e5ba commit 29614f4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/aws-cpp-sdk-core/source/auth/signer/AWSAuthV4Signer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,11 @@ void AWSAuthV4Signer::UpdateUserAgentWithCredentialFeatures(Aws::Http::HttpReque
630630
}
631631
}
632632

633-
// Append credential features to existing UA
634-
Aws::String existingUA = request.GetHeaderValue(USER_AGENT);
635-
Aws::StringStream updatedUA;
636-
updatedUA << existingUA << " m/" << credentialFeatures.str();
637-
638-
request.SetUserAgent(updatedUA.str());
633+
// Only append if we have credential features
634+
if (!credentialFeatures.str().empty()) {
635+
Aws::String existingUA = request.GetHeaderValue(USER_AGENT);
636+
Aws::StringStream updatedUA;
637+
updatedUA << existingUA << " m/" << credentialFeatures.str();
638+
request.SetUserAgent(updatedUA.str());
639+
}
639640
}

0 commit comments

Comments
 (0)