winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5de147ca87964d429f780858c39d5e54d4c2ae17
parent 7854e67566edd40956bcbc7f6f32958090f0ec1c
Author: yao-msft <50888816+yao-msft@users.noreply.github.com>
Date:   Wed, 20 Sep 2023 20:43:18 -0700

Set default user agent for range requests (#3645)


Diffstat:
Msrc/AppInstallerCommonCore/HttpStream/HttpClientWrapper.cpp | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/AppInstallerCommonCore/HttpStream/HttpClientWrapper.cpp b/src/AppInstallerCommonCore/HttpStream/HttpClientWrapper.cpp @@ -4,6 +4,7 @@ #include "pch.h" #include "Public/AppInstallerStrings.h" #include "HttpClientWrapper.h" +#include "Public/AppInstallerRuntime.h" using namespace winrt::Windows::Foundation; using namespace winrt::Windows::Security::Cryptography; @@ -32,6 +33,7 @@ namespace AppInstaller::Utility::HttpStream instance->m_httpClient.DefaultRequestHeaders().Connection().Clear(); instance->m_httpClient.DefaultRequestHeaders().Append(L"Connection", L"Keep-Alive"); + instance->m_httpClient.DefaultRequestHeaders().UserAgent().ParseAdd(Utility::ConvertToUTF16(Runtime::GetDefaultUserAgent().get())); co_await instance->PopulateInfoAsync();