Bug 8373 - HTTP 307, POST, Chunked Encoding and 100-continue
Summary: HTTP 307, POST, Chunked Encoding and 100-continue
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2012-11-13 12:17 UTC by Martin Baulig
Modified: 2016-11-11 10:16 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Martin Baulig 2012-11-13 12:17:57 UTC
A few days ago, while I was playing around with some WCF samples, I stumbled upon a problem in our HTTP stack related to HTTP 307, Chunked Encoding and POST.

There are several sub-issues to this problem:

1.) When the server replies with 307 Temporary Redirect to a POST request, the request body won't be submitted when resending the request to the new address.

2.) mod_mono reports a 500 Internal Server Error when trying to use chunked encoding, I ran a simple client app on Windows to make sure it's not a problem with sending the request.

3.) When making a request that contains a request body with HTTP 1.1, the .NET runtime waits 350 milliseconds for the 100-Continue before sending the body: http://blogs.msdn.com/b/fiddler/archive/2011/11/05/http-expect-continue-delays-transmitting-post-bodies-by-up-to-350-milliseconds.aspx

4.) Re-transmitting the request when using chunked encoding.  Our implementation does not buffer the request body when using chunked encoding.  I was wondering what to do when encountering a 307, so I played around a bit with a very simple TcpListener that speaks http, making it send/not send the 100-continue.  It looks like the .NET runtime is using the HttpWebRequest.AllowWriteStreamBuffering property to decide whether or not to buffer the request - you get an error if you either set that to false or the server did not send the 100-continue in time.  So this may actually be easy to fix.

I'm working on this, just wanted to gather a list of all the sub-issues that need to be addressed.
Comment 2 Martin Baulig 2016-11-11 10:16:00 UTC
This has been fixed a long time ago.