You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/11/08 23:17:49 UTC

[trafficserver] branch 9.2.x updated: Fix output '\n' HTTP field line endings (#8455)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new feddf6b  Fix output '\n' HTTP field line endings (#8455)
feddf6b is described below

commit feddf6b9841a7a1908818a9d2cc61012e9e94e4a
Author: Brian Neradt <br...@verizonmedia.com>
AuthorDate: Wed Oct 27 13:35:41 2021 -0500

    Fix output '\n' HTTP field line endings (#8455)
    
    This is another attempt to fix what was initially addressed in #8096 but
    got backed out via #8305. That more extensive patch was considered too
    invasive and potentially risky.  This more targeted patch will fix
    clients that only send the \n endings but it will force the \r\n line
    ending on output.
    
    This was mostly in place except for header lines that get
    m_n_v_raw_printable set, which seems to be most header lines. The
    addition checks to see if the header line ends in \r\n. If it does not
    the m_n_v_raw_printable flag gets cleared and the logic that explicitly
    adds the line endings while be invoked on output.
    
    (cherry picked from commit 64f25678bfbbd1433cce703e3c43bcc49a53de56)
---
 proxy/hdrs/MIME.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index 14e7ce3..729ec9d 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -2580,6 +2580,8 @@ mime_parser_parse(MIMEParser *parser, HdrHeap *heap, MIMEHdrImpl *mh, const char
       }
       field_name.rtrim_if(&ParseRules::is_ws);
       raw_print_field = false;
+    } else if (parsed.suffix(2) != "\r\n") {
+      raw_print_field = false;
     }
 
     // find value first