From cc5565d30fb9d241362d071731dfdf2a6cea48fd Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 21 Aug 2019 16:13:31 -0700 Subject: [PATCH 1/2] Add version to UserAgent on Win launcher --- launchers/win32/LauncherManager.cpp | 6 +++--- launchers/win32/LauncherManager.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/launchers/win32/LauncherManager.cpp b/launchers/win32/LauncherManager.cpp index 5efcb38cf6..5e452b97b2 100644 --- a/launchers/win32/LauncherManager.cpp +++ b/launchers/win32/LauncherManager.cpp @@ -405,7 +405,7 @@ LauncherUtils::ResponseError LauncherManager::readOrganizationJSON(const CString CString contentTypeJson = L"content-type:application/json"; CString response; CString url = _T("/organizations/") + hash + _T(".json"); - LauncherUtils::ResponseError error = LauncherUtils::makeHTTPCall(L"HQ Launcher", + LauncherUtils::ResponseError error = LauncherUtils::makeHTTPCall(getHttpUserAgent(), L"orgs.highfidelity.com", url, contentTypeJson, CStringA(), response, false); @@ -464,7 +464,7 @@ void LauncherManager::getMostRecentBuilds(CString& launcherUrlOut, CString& laun } onMostRecentBuildsReceived(response, error); }; - LauncherUtils::httpCallOnThread(L"HQ Launcher", + LauncherUtils::httpCallOnThread(getHttpUserAgent(), L"thunder.highfidelity.com", L"/builds/api/tags/latest?format=json", contentTypeJson, CStringA(), false, httpCallback); @@ -530,7 +530,7 @@ LauncherUtils::ResponseError LauncherManager::getAccessTokenForCredentials(const CString contentTypeText = L"content-type:application/x-www-form-urlencoded"; CString response; - LauncherUtils::ResponseError error = LauncherUtils::makeHTTPCall(L"HQ Launcher", + LauncherUtils::ResponseError error = LauncherUtils::makeHTTPCall(getHttpUserAgent(), L"metaverse.highfidelity.com", L"/oauth/token", contentTypeText, post, diff --git a/launchers/win32/LauncherManager.h b/launchers/win32/LauncherManager.h index 18ac041b3b..910d6d054d 100644 --- a/launchers/win32/LauncherManager.h +++ b/launchers/win32/LauncherManager.h @@ -134,6 +134,7 @@ public: void updateProgress(ProcessType processType, float progress); void onCancel(); const CString& getLauncherVersion() const { return _launcherVersion; } + CString getHttpUserAgent() const { return L"HQLauncher/" + _launcherVersion; } private: ProcessType _currentProcess { ProcessType::DownloadApplication }; From a73f69c62abffc8bffd6467896d3176cddf5bd05 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 22 Aug 2019 09:09:07 -0700 Subject: [PATCH 2/2] Add platform to UserAgent on win launcher --- launchers/win32/LauncherManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchers/win32/LauncherManager.h b/launchers/win32/LauncherManager.h index 910d6d054d..d0c81ae75b 100644 --- a/launchers/win32/LauncherManager.h +++ b/launchers/win32/LauncherManager.h @@ -134,7 +134,7 @@ public: void updateProgress(ProcessType processType, float progress); void onCancel(); const CString& getLauncherVersion() const { return _launcherVersion; } - CString getHttpUserAgent() const { return L"HQLauncher/" + _launcherVersion; } + CString getHttpUserAgent() const { return L"HQLauncher/" + _launcherVersion + L" (Windows)"; } private: ProcessType _currentProcess { ProcessType::DownloadApplication };