diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-07-30 19:16:42 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2018-08-10 20:16:14 +0300 |
commit | 98729c07f710b5b088307dc197e00f6f6569a0fb (patch) | |
tree | d7b7c4afdaecfed981bab64b72a418e98ea2783c /map | |
parent | 693a9917286acd1646962e9bf292ed6f356c1b5c (diff) |
[Core] Added user agent for http requests
Diffstat (limited to 'map')
-rw-r--r-- | map/cloud.cpp | 1 | ||||
-rw-r--r-- | map/local_ads_manager.cpp | 1 | ||||
-rw-r--r-- | map/user.cpp | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/map/cloud.cpp b/map/cloud.cpp index c72f62a6a0..45a13d3991 100644 --- a/map/cloud.cpp +++ b/map/cloud.cpp @@ -231,6 +231,7 @@ Cloud::RequestResult CloudRequestWithResult(std::string const & url, request.SetTimeout(kRequestTimeoutInSec); request.SetRawHeader("Accept", kApplicationJson); request.SetRawHeader("Authorization", BuildAuthenticationToken(accessToken)); + request.SetUserAgent(GetPlatform().GetAppUserAgent()); request.SetBodyData(SerializeToJson(RequestDataType(args...)), kApplicationJson); if (request.RunHttpRequest() && !request.WasRedirected()) diff --git a/map/local_ads_manager.cpp b/map/local_ads_manager.cpp index b3a7074a39..65e9cca8e1 100644 --- a/map/local_ads_manager.cpp +++ b/map/local_ads_manager.cpp @@ -414,6 +414,7 @@ bool LocalAdsManager::DownloadCampaign(MwmSet::MwmId const & mwmId, std::vector< platform::HttpClient request(url); request.SetTimeout(5); // timeout in seconds + request.SetUserAgent(GetPlatform().GetAppUserAgent()); bool const success = request.RunHttpRequest() && request.ErrorCode() == 200; std::lock_guard<std::mutex> lock(m_campaignsMutex); diff --git a/map/user.cpp b/map/user.cpp index 175f2d367a..fad56d1167 100644 --- a/map/user.cpp +++ b/map/user.cpp @@ -565,6 +565,7 @@ void User::RequestImpl(std::string const & url, BuildRequestHandler const & onBu platform::HttpClient request(url); request.SetRawHeader("Accept", kApplicationJson); + request.SetUserAgent(GetPlatform().GetAppUserAgent()); if (onBuildRequest) onBuildRequest(request); |