[FIX] Do not use chunked encoding with CGI/FastCGI

it's forbiden by http://tools.ietf.org/html/rfc3875#section-6.3.4

This correct bug 10001, https://bugzilla.xamarin.com/show_bug.cgi?id=10001

Signed-off-by: Etienne CHAMPETIER <[email protected]>
This commit is contained in:
Stefan authored and Etienne CHAMPETIER committed 2013-09-02 17:30:14 +02:00
1 parent af31330de4
commit b6d634dd24
1 file changed
+8 -2
@@ -127,8 +127,14 @@ namespace System.Web
this.context = context;
#if !TARGET_J2EE
if (worker_request != null)
use_chunked = (worker_request.GetHttpVersion () == "HTTP/1.1");
if (worker_request != null) {
if (worker_request.GetHttpVersion () == "HTTP/1.1") {
string gatewayIface = context.Request.ServerVariables ["GATEWAY_INTERFACE"];
use_chunked = (String.IsNullOrEmpty (gatewayIface) || !gatewayIface.StartsWith ("cgi", StringComparison.OrginalIgnoreCase));
} else {
use_chunked = false;
}
}
#endif
writer = new HttpWriter (this);
}