Skip to content

Commit ed52046

Browse files
committed
Modified Http.Sync.cs and Http.Async.cs to replace
ServicePointManager.Expect100Continue = false; with webRequest.ServicePoint.Expect100Continue = false; The original version sets the default for future ServicePoints, not the current ServicePoint. I don't think setting the global default here is a great idea, and it doesn't affect the current ServicePoint which has already been created.
1 parent a6b86a5 commit ed52046

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

RestSharp/Http.Async.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ private HttpWebRequest ConfigureAsyncWebRequest(string method, Uri url)
443443
}
444444

445445
webRequest.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip | DecompressionMethods.None;
446-
ServicePointManager.Expect100Continue = false;
446+
447+
webRequest.ServicePoint.Expect100Continue = false;
447448

448449
if (Timeout != 0)
449450
{

RestSharp/Http.Sync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private HttpWebRequest ConfigureWebRequest(string method, Uri url)
254254
#endif
255255
webRequest.PreAuthenticate = PreAuthenticate;
256256

257-
ServicePointManager.Expect100Continue = false;
257+
webRequest.ServicePoint.Expect100Continue = false;
258258

259259
AppendHeaders(webRequest);
260260
AppendCookies(webRequest);

0 commit comments

Comments
 (0)