Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows version checking before setting proxy flag #2703

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <winhttp.h>
#include <sstream>
#include <iostream>
#include <versionhelpers.h>

using namespace Aws::Client;
using namespace Aws::Http;
Expand Down Expand Up @@ -52,10 +53,16 @@ WinHttpSyncHttpClient::WinHttpSyncHttpClient(const ClientConfiguration& config)
<< " request timeout " << config.requestTimeoutMs << ",and connect timeout " << config.connectTimeoutMs);

#if defined(WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY)
DWORD winhttpFlags = config.allowSystemProxy ? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY : WINHTTP_ACCESS_TYPE_NO_PROXY;
DWORD winhttpFlags;
if (config.allowSystemProxy) {
siwei-yuan marked this conversation as resolved.
Show resolved Hide resolved
winhttpFlags = IsWindows8Point1OrGreater()? WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY : WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
} else {
winhttpFlags = WINHTTP_ACCESS_TYPE_NO_PROXY;
}
#else
DWORD winhttpFlags = config.allowSystemProxy ? WINHTTP_ACCESS_TYPE_DEFAULT_PROXY : WINHTTP_ACCESS_TYPE_NO_PROXY;
#endif

const char* proxyHosts = nullptr;
Aws::String strProxyHosts;

Expand Down