Skip to content
Merged
Changes from all commits
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
Only add proxy settings to handler if supported
  • Loading branch information
SebastianGrief committed Sep 19, 2022
commit befbf8539fa7d894dbaab8e13af4a3241d0e5709
6 changes: 5 additions & 1 deletion src/RestSharp/RestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ void ConfigureHttpMessageHandler(HttpClientHandler handler) {
handler.AutomaticDecompression = Options.AutomaticDecompression;
handler.PreAuthenticate = Options.PreAuthenticate;
handler.AllowAutoRedirect = Options.FollowRedirects;
handler.Proxy = Options.Proxy;

if (handler.SupportsProxy)
{
handler.Proxy = Options.Proxy;
}

if (Options.RemoteCertificateValidationCallback != null)
handler.ServerCertificateCustomValidationCallback =
Expand Down