Skip to content

Commit

Permalink
[FIX] Do not use chunked encoding with CGI/FastCGI
Browse files Browse the repository at this point in the history
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 <etienne.champetier@fiducial.net>
  • Loading branch information
ststeiger authored and Etienne CHAMPETIER committed Sep 2, 2013
1 parent af31330 commit b6d634d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mcs/class/System.Web/System.Web/HttpResponse.cs
Expand Up @@ -127,8 +127,14 @@ internal HttpResponse (HttpWorkerRequest worker_request, HttpContext context) :
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);
}
Expand Down

0 comments on commit b6d634d

Please sign in to comment.