Skip to content

Commit b1ba3b9

Browse files
committed
Fix compilation with WinHttpPAL
1 parent 005db7b commit b1ba3b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Release/src/http/client/http_client_winhttp.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ class winhttp_client final : public _http_client_communicator
937937
&winhttp_client::completion_callback,
938938
WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_FLAG_HANDLES |
939939
WINHTTP_CALLBACK_FLAG_SECURE_FAILURE | WINHTTP_CALLBACK_FLAG_SEND_REQUEST |
940-
WINHTTP_CALLBACK_FLAG_REDIRECT,
940+
WINHTTP_CALLBACK_STATUS_REDIRECT,
941941
0))
942942
{
943943
return GetLastError();
@@ -1133,6 +1133,9 @@ class winhttp_client final : public _http_client_communicator
11331133
return;
11341134
}
11351135

1136+
// WinHttpPAL does not currently provide these options
1137+
// See https://github.com/microsoft/WinHttpPAL/issues/1
1138+
#if !defined(CPPREST_FORCE_HTTP_CLIENT_WINHTTPPAL)
11361139
if (client_config().max_redirects() == 0)
11371140
{
11381141
// Disable auto redirects.
@@ -1185,6 +1188,7 @@ class winhttp_client final : public _http_client_communicator
11851188
return;
11861189
}
11871190
}
1191+
#endif
11881192

11891193
size_t content_length;
11901194
try

0 commit comments

Comments
 (0)