From c825a70eebc9e8596587d7bbac2f47ef718a7e73 Mon Sep 17 00:00:00 2001
From: Dirk Wetter <dirk@testssl.sh>
Date: Thu, 20 Mar 2025 13:22:55 +0100
Subject: [PATCH] Remove inherited double line

.. and update the comment
---
 testssl.sh | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/testssl.sh b/testssl.sh
index 8e6ef8b..ceeb19c 100755
--- a/testssl.sh
+++ b/testssl.sh
@@ -2196,15 +2196,10 @@ connectivity_problem() {
 }
 
 sanitze_http_header() {
-     # Quit on first empty line to catch 98% of the cases. Next pattern is there because the SEDs tested
-     # so far seem not to be fine with header containing x0d x0a (CRLF) which is the usual case.
-     # So we also trigger also on any sign on a single line which is not alphanumeric (plus _)
-     #
-     # Also we use tr here to remove any crtl chars which the server side offers --> possible security problem
-     # Only allowed now is LF + CR. See #2337
-     # awk, see above, doesn't seem to care
+     # sed implemntations tested were sometime not fine with header containing x0d x0a (CRLF) which is the usual
+     # case.  Also we use tr here to remove any crtl chars which the server side offers --> possible security problem
+     # Only allowed now is LF + CR. See #2337.  awk OTOH, see above, doesn't seem to care -- but not under MacOS
      sed -e '/^$/q' -e '/^[^a-zA-Z_0-9]$/q' $HEADERFILE | tr -d '\000-\011\013\014\016-\037' >$HEADERFILE.tmp
-     sed -e '/^$/q' -e '/^[^a-zA-Z_0-9]$/q' $HEADERFILE | tr -d '\000-\010\013\014\016-\037' >$HEADERFILE.tmp
      # Now to be more sure we delete from '<' or '{' maybe with a leading blank until the end
      sed -e '/^ *<.*$/d' -e '/^ *{.*$/d' $HEADERFILE.tmp >$HEADERFILE
      debugme echo -e "---\n $(< $HEADERFILE) \n---"