Skip to content

Commit a2b9a05

Browse files
authored
Disable WINHTTP_AUTOPROXY_OPTIONS machinery when using WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY. (#1040)
1 parent 91f66c6 commit a2b9a05

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Release/src/http/client/http_client_winhttp.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,12 @@ class winhttp_client final : public _http_client_communicator
803803
access_type = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
804804
proxy_name = WINHTTP_NO_PROXY_NAME;
805805

806-
#ifndef CPPREST_TARGET_XP
806+
#ifdef CPPREST_TARGET_XP
807+
if (config.proxy().is_auto_discovery())
808+
{
809+
m_proxy_auto_config = true;
810+
}
811+
#else // ^^^ CPPREST_TARGET_XP ^^^ // vvv !CPPREST_TARGET_XP vvv
807812
if (IsWindows8Point1OrGreater())
808813
{
809814
// 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
843848
}
844849
}
845850
}
846-
}
847-
#endif
848851

849-
if (config.proxy().is_auto_discovery())
850-
{
851-
m_proxy_auto_config = true;
852+
if (config.proxy().is_auto_discovery())
853+
{
854+
m_proxy_auto_config = true;
855+
}
852856
}
857+
#endif // CPPREST_TARGET_XP
853858
}
854859
else
855860
{

0 commit comments

Comments
 (0)