Skip to content

Commit 22b185b

Browse files
committed
Improve proxy handling for newer versions of windows
1 parent b605732 commit 22b185b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/RequestHandler_WinHTTP.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <Windows.h>
77
#include <winhttp.h>
8+
#include <Versionhelpers.h>
89

910
#include "RequestHandler_WinHTTP.hpp"
1011
#include "../third_party/curl/isunreserved.hpp"
@@ -124,7 +125,9 @@ RequestHandler_WinHTTP_PostBuilder::make(basic_Error & e)
124125

125126

126127
hSession = WinHttpOpen( L"Cryptolens WinHTTP"
127-
, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
128+
, IsWindows8Point1OrGreater()
129+
? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY
130+
: WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
128131
, WINHTTP_NO_PROXY_NAME
129132
, WINHTTP_NO_PROXY_BYPASS
130133
, 0);

0 commit comments

Comments
 (0)