aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAL <codemeow@ieee.org>2018-06-26 17:13:56 +0800
committerRobert Schumacher <roschuma@microsoft.com>2018-06-26 02:13:56 -0700
commit617be1b01d7ddfed4f36be45db53965e13be9cc0 (patch)
treeb66a139ecba02cba7517f4eb745c627bc0079f15
parentbb5303c6e11b13acb39e6c6dbdee1c10c62a761c (diff)
downloadvcpkg-617be1b01d7ddfed4f36be45db53965e13be9cc0.tar.gz
vcpkg-617be1b01d7ddfed4f36be45db53965e13be9cc0.zip
Use WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY instead of WINHTTP_ACCESS_TYPE_DEFAULT_PROXY when Windows 8.1 and newer (#3785)
-rw-r--r--toolsrc/src/vcpkg/base/downloads.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/toolsrc/src/vcpkg/base/downloads.cpp b/toolsrc/src/vcpkg/base/downloads.cpp
index a5ee05391..d23e6194b 100644
--- a/toolsrc/src/vcpkg/base/downloads.cpp
+++ b/toolsrc/src/vcpkg/base/downloads.cpp
@@ -4,6 +4,8 @@
#include <vcpkg/base/util.h>
#include <vcpkg/commands.h>
+#include <VersionHelpers.h>
+
namespace vcpkg::Downloads
{
#if defined(_WIN32)
@@ -29,7 +31,9 @@ namespace vcpkg::Downloads
std::to_string(err));
auto hSession = WinHttpOpen(
- L"vcpkg/1.0", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
+ L"vcpkg/1.0",
+ IsWindows8Point1OrGreater() ? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY : WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
+ WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
Checks::check_exit(VCPKG_LINE_INFO, hSession, "WinHttpOpen() failed: %d", GetLastError());
// Use Windows 10 defaults on Windows 7