Skip to content

Conversation

@adityamandaleeka
Copy link
Member

@adityamandaleeka adityamandaleeka commented Sep 4, 2021

Addresses #35974

Keeping this in draft while I confirm this is the expected behavior.
Update 9/9: client/server interoperability has been verified. This should be good.

@ghost ghost added the area-runtime label Sep 4, 2021
@JamesNK
Copy link
Member

JamesNK commented Sep 4, 2021

@Tratcher In what situation does HttpClient send a 100 continue?

Is this something we can test end-to-end in the interop tests, or is it difficult to trigger 100 continue from HttpClient?

@Tratcher
Copy link
Member

Tratcher commented Sep 4, 2021

Sending Expect: 100-continue with HttpClient is easy.
httpRequestMessage.Headers.ExpectContinue = true

Triggering the 100 response on the server is easy, you just read the request body.

The real trick is observing that the 100 response happened, it's implicitly sent by the server and implicitly handled by HttpClient, the app code on either side never sees it.

Try this:
socketsHttpHandler.Expect100ContinueTimeout = TimeSpan.FromDays(1);
Then add a 10s timeout CT on the request body read calls.

This will prevent the client from sending the body until the 100 response is received. If the server doesn't send the 100 response then the client will not send the data and the server read will time out.

@adityamandaleeka
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/aspnetcore/actions/runs/1223025051

@adityamandaleeka adityamandaleeka enabled auto-merge (squash) September 10, 2021 23:05
@adityamandaleeka adityamandaleeka merged commit b33b4d4 into dotnet:main Sep 11, 2021
@ghost ghost added this to the 7.0-preview1 milestone Sep 11, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants