File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,34 @@ namespace Aws
3838 return m_features;
3939 }
4040
41+ /* *
42+ * Set the user agent for this context
43+ */
44+ void SetUserAgent (const std::shared_ptr<Aws::Client::UserAgent>& userAgent)
45+ {
46+ m_userAgent = userAgent;
47+ }
48+
49+ /* *
50+ * Get the user agent associated with this context
51+ */
52+ const std::shared_ptr<Aws::Client::UserAgent>& GetUserAgent () const
53+ {
54+ return m_userAgent;
55+ }
56+
57+ /* *
58+ * Check if this context has a custom user agent
59+ */
60+ bool HasCustomUserAgent () const
61+ {
62+ return m_userAgent && m_userAgent->HasOverrideUserAgent ();
63+ }
64+
65+
4166 private:
4267 Aws::Set<Aws::Client::UserAgentFeature> m_features;
68+ std::shared_ptr<Aws::Client::UserAgent> m_userAgent;
4369 };
4470
4571 /* *
Original file line number Diff line number Diff line change @@ -612,6 +612,11 @@ void AWSAuthV4Signer::UpdateUserAgentWithCredentialFeatures(Aws::Http::HttpReque
612612 return ;
613613 }
614614
615+ if (context.HasCustomUserAgent ()) {
616+ AWS_LOGSTREAM_DEBUG (v4LogTag, " Custom User-Agent detected, skipping credential feature update" );
617+ return ;
618+ }
619+
615620 const auto features = context.GetUserAgentFeatures ();
616621 if (features.empty ()) {
617622 AWS_LOGSTREAM_DEBUG (v4LogTag, " No credential features to add to User-Agent" );
You can’t perform that action at this time.
0 commit comments