Skip to content

Commit befbf85

Browse files
Only add proxy settings to handler if supported
1 parent 8cd6696 commit befbf85

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/RestSharp/RestClient.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ void ConfigureHttpMessageHandler(HttpClientHandler handler) {
139139
handler.AutomaticDecompression = Options.AutomaticDecompression;
140140
handler.PreAuthenticate = Options.PreAuthenticate;
141141
handler.AllowAutoRedirect = Options.FollowRedirects;
142-
handler.Proxy = Options.Proxy;
142+
143+
if (handler.SupportsProxy)
144+
{
145+
handler.Proxy = Options.Proxy;
146+
}
143147

144148
if (Options.RemoteCertificateValidationCallback != null)
145149
handler.ServerCertificateCustomValidationCallback =

0 commit comments

Comments
 (0)