Skip to content

Commit 46de1e6

Browse files
committed
[dotnet] Explicitly remove Expect header
When using the HttpClient class, the behavior for an HTTP POST request is different between .NET Framework and .NET Core. In the .NET Framework case, the client automatically adds an `Expect: 100-Continue` header. When the remote end does not send a 100 response, the client hangs waiting for it. This change explicitly removes that header for all HTTP requests. Fixes issue #9277.
1 parent 8e1a3f6 commit 46de1e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dotnet/src/webdriver/Remote/HttpCommandExecutor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ private void CreateHttpClient()
256256
this.client = new HttpClient(httpClientHandler);
257257
this.client.DefaultRequestHeaders.UserAgent.ParseAdd(this.UserAgent);
258258
this.client.DefaultRequestHeaders.Accept.ParseAdd(RequestAcceptHeader);
259+
this.client.DefaultRequestHeaders.ExpectContinue = false;
259260
if (!this.IsKeepAliveEnabled)
260261
{
261262
this.client.DefaultRequestHeaders.Connection.ParseAdd("close");

0 commit comments

Comments
 (0)