You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sj...@apache.org on 2010/02/19 02:52:25 UTC

svn commit: r911672 - /incubator/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc

Author: sjiang
Date: Fri Feb 19 01:52:25 2010
New Revision: 911672

URL: http://svn.apache.org/viewvc?rev=911672&view=rev
Log:
TS-189: TS should not send Transfer-Encoding header for responses with an empty body
Fix to avoid chunked headers to client when response code precludes body 

        Author: Steve Jiang
        Review: Bryan Call


Modified:
    incubator/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc

Modified: incubator/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=911672&r1=911671&r2=911672&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ incubator/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Fri Feb 19 01:52:25 2010
@@ -8215,6 +8215,8 @@
         s->client_info.http_version == HTTPVersion(1, 1) &&
         ((s->http_config_param->chunking_enabled == 1 && s->remap_chunking_enabled != 0) ||
          (s->http_config_param->chunking_enabled == 0 && s->remap_chunking_enabled == 1)) &&
+        // if we're not sending a body, don't set a chunked header regardless of server response
+        !is_response_body_precluded(s->hdr_info.client_response.status_get(), s->method) &&
          // we do not need chunked encoding for internal error messages
          // that are sent to the client if the server response is not valid.
          ((s->source == SOURCE_HTTP_ORIGIN_SERVER &&