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

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: 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..3df08303a3ab1684b16db28a8d32a02da46809ed 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,16 @@ void TokenValidatorImpl::StartValidateRequest(const std::string& token) {
request_ = request_context_getter_->GetURLRequestContext()->CreateRequest(
third_party_auth_config_.token_validation_url, net::DEFAULT_PRIORITY,
this);
+
+ // Set a user-agent for logging/auditing purposes.
+#if defined(GOOGLE_CHROME_BUILD)
+ #define APP_NAME "Chrome Remote Desktop"
Sergey Ulanov 2016/05/18 07:11:02 Don't need to use #define here. std::string app_na
Lambros 2016/05/18 18:49:44 Done.
+#else
+ #define APP_NAME "Chromoting"
+#endif
+ request_->SetExtraRequestHeaderByName(net::HttpRequestHeaders::kUserAgent,
+ APP_NAME " " STRINGIZE(VERSION), true);
Sergey Ulanov 2016/05/18 07:11:02 Add a check that VERSION is defined: #ifndef VERSI
Lambros 2016/05/18 18:49:44 Done. (git cl format removes indentation of #error
+
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