Chromium Code Reviews| 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); |