You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2017/01/24 04:50:23 UTC
[trafficserver] branch master updated: Skip modifying response
length for HEAD response
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 <ks...@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" <co...@trafficserver.apache.org>'].