diff --git a/src/AppInstallerCommonCore/MSStoreDownload.cpp b/src/AppInstallerCommonCore/MSStoreDownload.cpp index 4c7dc63253..dc4f409949 100644 --- a/src/AppInstallerCommonCore/MSStoreDownload.cpp +++ b/src/AppInstallerCommonCore/MSStoreDownload.cpp @@ -6,11 +6,12 @@ #include #include "AppInstallerMsixInfo.h" #include "AppInstallerRuntime.h" -#include "winget/Locale.h" +#include "winget/HttpClientHelper.h" #include "winget/JsonUtil.h" +#include "winget/Locale.h" #include "winget/MSStoreDownload.h" +#include "winget/NetworkSettings.h" #include "winget/Rest.h" -#include "winget/HttpClientHelper.h" #include "winget/UserSettings.h" #ifndef WINGET_DISABLE_FOR_FUZZING #include @@ -910,6 +911,12 @@ namespace AppInstaller::MSStore { SFS::RequestParams sfsClientRequest; sfsClientRequest.productRequests = { {std::string{ wuCategoryId }, {}} }; + const auto& proxyUri = AppInstaller::Settings::Network().GetProxyUri(); + if (proxyUri) + { + AICLI_LOG(Core, Info, << "Passing proxy to SFS client " << *proxyUri); + sfsClientRequest.proxy = *proxyUri; + } auto requestResult = GetSfsClientInstance()->GetLatestAppDownloadInfo(sfsClientRequest, appContents); if (!requestResult) diff --git a/src/AppInstallerCommonCore/Public/winget/NetworkSettings.h b/src/AppInstallerCommonCore/Public/winget/NetworkSettings.h index 856055fcc8..ea90ab7f1d 100644 --- a/src/AppInstallerCommonCore/Public/winget/NetworkSettings.h +++ b/src/AppInstallerCommonCore/Public/winget/NetworkSettings.h @@ -16,7 +16,7 @@ namespace AppInstaller::Settings { static NetworkSettings& Instance(); - const std::optional GetProxyUri() const { return m_proxyUri; } + const std::optional& GetProxyUri() const { return m_proxyUri; } // Sets the proxy URI; may do nothing depending on admin settings and group policy void SetProxyUri(const std::optional& proxyUri); @@ -30,4 +30,4 @@ namespace AppInstaller::Settings }; NetworkSettings& Network(); -} \ No newline at end of file +}