Repository: trafficserver Updated Branches: refs/heads/master a2d3a52a6 -> 94ed95b15
TS-2616: Sanitize duplicate Transfer-Encoding: chunked headers Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/94ed95b1 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/94ed95b1 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/94ed95b1 Branch: refs/heads/master Commit: 94ed95b15ee7486eb7286d05ac65117690808ecf Parents: a2d3a52 Author: Dimitry Andric <[email protected]> Authored: Wed Apr 23 13:16:23 2014 -0700 Committer: James Peach <[email protected]> Committed: Wed Apr 23 13:16:23 2014 -0700 ---------------------------------------------------------------------- CHANGES | 3 +++ proxy/http/HttpTransact.cc | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/94ed95b1/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 906d9b6..6ffcde2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.0.0 + *) [TS-2616] Sanitize duplicate Transfer-Encoding: chunked headers. + Author: Dimitry Andric <[email protected]> + *) [TS-645] Remove broken hard restart from traffic_shell. *) [TS-2562] Improve init script support for Debian/Ubuntu. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/94ed95b1/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index 636d84f..c646869 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -5832,11 +5832,10 @@ 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); - // FIX ME: What is chunked appears more than once? Old - // code didn't deal with this so I don't either if (wks_value == HTTP_VALUE_CHUNKED) { - if (!s->cop_test_page) + if (!s->cop_test_page) { DebugTxn("http_hdrs", "[init_state_vars_from_resp] transfer encoding: chunked!"); + } s->current.server->transfer_encoding = CHUNKED_ENCODING; s->hdr_info.response_content_length = HTTP_UNDEFINED_CL; @@ -5853,7 +5852,8 @@ HttpTransact::initialize_state_variables_from_response(State* s, HTTPHdr* incomi // Loop over the all the values in existing Trans-enc header and // copy the ones that aren't our chunked value to a new field while (new_enc_val) { - if (new_enc_val != enc_value) { + const char *new_wks_value = hdrtoken_string_to_wks(new_enc_val, new_enc_len); + if (new_wks_value != wks_value) { if (new_enc_field) { new_enc_field->value_append(incoming_response->m_heap, incoming_response->m_mime, new_enc_val, new_enc_len, true); } else {
