From a2b9a0542b26c8b6521f5578adac324966b6cb14 Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Mon, 11 Feb 2019 14:39:08 -0800 Subject: [PATCH] Disable WINHTTP_AUTOPROXY_OPTIONS machinery when using WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY. (#1040) --- Release/src/http/client/http_client_winhttp.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Release/src/http/client/http_client_winhttp.cpp b/Release/src/http/client/http_client_winhttp.cpp index eb94f0f984..61a13abfb5 100644 --- a/Release/src/http/client/http_client_winhttp.cpp +++ b/Release/src/http/client/http_client_winhttp.cpp @@ -803,7 +803,12 @@ class winhttp_client final : public _http_client_communicator access_type = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY; proxy_name = WINHTTP_NO_PROXY_NAME; -#ifndef CPPREST_TARGET_XP +#ifdef CPPREST_TARGET_XP + if (config.proxy().is_auto_discovery()) + { + m_proxy_auto_config = true; + } +#else // ^^^ CPPREST_TARGET_XP ^^^ // vvv !CPPREST_TARGET_XP vvv if (IsWindows8Point1OrGreater()) { // Windows 8.1 and newer supports automatic proxy discovery and auto-fallback to IE proxy settings @@ -843,13 +848,13 @@ class winhttp_client final : public _http_client_communicator } } } - } -#endif - if (config.proxy().is_auto_discovery()) - { - m_proxy_auto_config = true; + if (config.proxy().is_auto_discovery()) + { + m_proxy_auto_config = true; + } } +#endif // CPPREST_TARGET_XP } else {