Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: remoting/host/token_validator_factory_impl.cc

Issue 1987863002: [remoting host] Add User-Agent to third-party cert validation requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/token_validator_factory_impl.cc
diff --git a/remoting/host/token_validator_factory_impl.cc b/remoting/host/token_validator_factory_impl.cc
index 972a4100b0e23199388550a76bec1d095a213986..a99b1d89906d83fec38e1017fec6b56e6adc5a0d 100644
--- a/remoting/host/token_validator_factory_impl.cc
+++ b/remoting/host/token_validator_factory_impl.cc
@@ -17,6 +17,7 @@
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
+#include "base/strings/stringize_macros.h"
#include "base/values.h"
#include "crypto/random.h"
#include "net/base/elements_upload_data_stream.h"
@@ -89,6 +90,20 @@ void TokenValidatorImpl::StartValidateRequest(const std::string& token) {
request_ = request_context_getter_->GetURLRequestContext()->CreateRequest(
third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY,
this);
+
+#if defined(GOOGLE_CHROME_BUILD)
+ std::string app_name = "Chrome Remote Desktop";
+#else
+ std::string app_name = "Chromoting";
+#endif
+#ifndef VERSION
+#error VERSION is not set.
+#endif
+ // Set a user-agent for logging/auditing purposes.
+ request_->SetExtraRequestHeaderByName(net::HttpRequestHeaders::kUserAgent,
+ app_name + " " + STRINGIZE(VERSION),
+ true);
+
request_->SetExtraRequestHeaderByName(
net::HttpRequestHeaders::kContentType,
"application/x-www-form-urlencoded", true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698