From f6e27a48c32c4ccdc58f5f938c5bca5c54cef2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flor=20Chac=C3=B3n?= <14323496+florelis@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:59:18 -0700 Subject: [PATCH] Fix downloader selection (#4696) Resolves #4695 ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4696) --- .github/actions/spelling/allow.txt | 1 + src/AppInstallerCommonCore/NetworkSettings.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 0a90dc762a..809babdc53 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -17,6 +17,7 @@ appxsdk APSTUDIO ARRAYSIZE artifactstagingdirectory +Asn aspirational Authenticode AUTOLISTEN diff --git a/src/AppInstallerCommonCore/NetworkSettings.cpp b/src/AppInstallerCommonCore/NetworkSettings.cpp index 625df53f12..2cf8e24b7d 100644 --- a/src/AppInstallerCommonCore/NetworkSettings.cpp +++ b/src/AppInstallerCommonCore/NetworkSettings.cpp @@ -26,17 +26,21 @@ namespace AppInstaller::Settings InstallerDownloader NetworkSettings::GetInstallerDownloader() const { // The default is DeliveryOptimization. - // We only use WinINet if specified by settings, or if we want to use proxy (as DO does not support that) + // We use WinINet if specified by settings, or if we want to use proxy (as DO does not support that) InstallerDownloader setting = User().Get(); - if (setting != InstallerDownloader::WinInet && m_proxyUri) + if (m_proxyUri && setting != InstallerDownloader::WinInet) { AICLI_LOG(Core, Info, << "Forcing use of wininet for download as DO does not support proxy"); return InstallerDownloader::WinInet; } - else // Default or DO + else if (setting == InstallerDownloader::Default) { return InstallerDownloader::DeliveryOptimization; + } + else + { + return setting; } }