Skip to content

Commit 4011ba1

Browse files
committed
Don't use proxy in BingRequest sample if not defined
Using empty proxy URI results in failing to open the connection when using WinHTTP, so the current code is broken out of the box.
1 parent b77c773 commit 4011ba1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Release/samples/BingRequest/bingrequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ web::http::client::http_client_config client_config_for_proxy()
2929
wchar_t* pValue;
3030
size_t len;
3131
auto err = _wdupenv_s(&pValue, &len, L"http_proxy");
32-
if (!err) {
32+
if (!err && pValue) {
3333
std::unique_ptr<wchar_t, void(*)(wchar_t*)> holder(pValue, [](wchar_t* p) { free(p); });
3434
uri proxy_uri(std::wstring(pValue, len));
3535
#else

0 commit comments

Comments
 (0)