Add support for HTTP/1.0 responses without 'Content-Lenght' header #403
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
InputNetworkStream.InternalRead()
to detect the cases when in http 1.0 and the connection is closed.IKnownWhenDone
(originally only for chunked encoding) to pass the information to the caller (StreamContent
).StreamContent
to take in account the last bytes returned byInputNetworkStream.Read()
whenIKnownWhenDone.IsDone == true
(was always 0 with chunked encoding).Motivation and Context
Both HttpClient and HttpWebRequest does not handle case where the server does not include a
Content-Length
and closes the connection to mark the end of the body.How Has This Been Tested?
Changes tested against several http servers with an ESP32 in debug mode, using HttpClient and HttpWebRequest.
Response was written to VS output and compared to the response captured using 'Telerik Fiddler'.
Screenshots
Types of changes
Checklist: