]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: support crlf="yes" for verify/proxy
authorDaniel Stenberg <daniel@haxx.se>
Tue, 27 Dec 2022 10:50:23 +0000 (11:50 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 27 Dec 2022 14:22:32 +0000 (15:22 +0100)
tests/FILEFORMAT.md
tests/runtests.pl

index 8143967db3d8487dd2a1106f95881bec8d9ee0c1..be111678e2f5994bb1fa7512e57111e4bdb3f58e 100644 (file)
@@ -566,7 +566,7 @@ changing protocol data such as port numbers or user-agent strings.
 One perl op per line that operates on the protocol dump. This is pretty
 advanced. Example: `s/^EPRT .*/EPRT stripped/`.
 
-### `<protocol [nonewline="yes"] crlf="yes">`
+### `<protocol [nonewline="yes"][crlf="yes"]>`
 
 the protocol dump curl should transmit, if `nonewline` is set, we will cut off
 the trailing newline of this given data before comparing with the one actually
@@ -576,7 +576,7 @@ comparisons are made.
 `crlf=yes` forces the newlines to become CRLF even if not written so in the
 test.
 
-### `<proxy [nonewline="yes"]>`
+### `<proxy [nonewline="yes"][crlf="yes"]>`
 
 The protocol dump curl should transmit to an HTTP proxy (when the http-proxy
 server is used), if `nonewline` is set, we will cut off the trailing newline
index 274911f47111feea9c04b1e9c09a0a499b68ce9d..33caf7c5cdb7c5586c6b140e1bc25da24d7c4c9e 100755 (executable)
@@ -4750,6 +4750,11 @@ sub singletest {
             }
         }
 
+        if($hash{'crlf'} ||
+           ($has_hyper && ($keywords{"HTTP"} || $keywords{"HTTPS"}))) {
+            map subNewlines(0, \$_), @protstrip;
+        }
+
         $res = compare($testnum, $testname, "proxy", \@out, \@protstrip);
         if($res) {
             return $errorreturncode;