Skip to content

Commit

Permalink
Merge pull request #752 from echampet/bug-10001-2
Browse files Browse the repository at this point in the history
[FIX][v2] Do not use chunked encoding with CGI/FastCGI
  • Loading branch information
grendello committed Sep 5, 2013
2 parents 9778d25 + da51407 commit 41f7b18
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mcs/class/System.Web/System.Web/HttpResponse.cs
Expand Up @@ -127,8 +127,13 @@ 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 && worker_request.GetHttpVersion () == "HTTP/1.1") {
string gi = worker_request.GetServerVariable ("GATEWAY_INTERFACE");
use_chunked = (String.IsNullOrEmpty (gi) ||
!gi.StartsWith ("cgi", StringComparison.OrdinalIgnoreCase));
} else {
use_chunked = false;
}
#endif
writer = new HttpWriter (this);
}
Expand Down

0 comments on commit 41f7b18

Please sign in to comment.