trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] branch master updated: Skip modifying response length for HEAD response
Date Tue, 24 Jan 2017 04:50:23 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  d64b8fe   Skip modifying response length for HEAD response
d64b8fe is described below

commit d64b8fea87795be71d7d51190cb8695dc051df64
Author: Shrihari Kalkar <kshri23@hotmail.com>
AuthorDate: Wed Aug 17 19:07:54 2016 -0700

    Skip modifying response length for HEAD response
    
    When we get a response to a HEAD request and if the response header
    has a 'CHUNKED' header we set the response length to undefined. We
    shouldn't be doing that because that length is used later to send the
    response to client.
---
 proxy/http/HttpTransact.cc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 51db96c..43fb782 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5817,7 +5817,7 @@ HttpTransact::initialize_state_variables_from_response(State *s, HTTPHdr
*incomi
     while (enc_value) {
       const char *wks_value = hdrtoken_string_to_wks(enc_value, enc_val_len);
 
-      if (wks_value == HTTP_VALUE_CHUNKED) {
+      if (wks_value == HTTP_VALUE_CHUNKED && !is_response_body_precluded(status_code,
s->method)) {
         if (!s->cop_test_page) {
           DebugTxn("http_hdrs", "[init_state_vars_from_resp] transfer encoding: chunked!");
         }
@@ -7990,12 +7990,8 @@ HttpTransact::build_response(State *s, HTTPHdr *base_response, HTTPHdr
*outgoing
 
   // If the response is prohibited from containing a body,
   //  we know the content length is trustable for keep-alive
-  if (is_response_body_precluded(status_code, s->method)) {
-    s->hdr_info.trust_response_cl       = true;
-    s->hdr_info.response_content_length = 0;
-    s->client_info.transfer_encoding    = HttpTransact::NO_TRANSFER_ENCODING;
-    s->server_info.transfer_encoding    = HttpTransact::NO_TRANSFER_ENCODING;
-  }
+  if (is_response_body_precluded(status_code, s->method))
+    s->hdr_info.trust_response_cl = true;
 
   handle_response_keep_alive_headers(s, outgoing_version, outgoing_response);
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message