[master] 4c8e0955b varnishtest: set -nolen on tx[req|resp] C-L or T-E

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Nov 28 15:33:06 UTC 2022


commit 4c8e0955badbb67ee52fd356e1f4d237b641f342
Author: AlveElde <alve_elde at hotmail.com>
Date:   Fri Sep 16 16:17:59 2022 +0200

    varnishtest: set -nolen on tx[req|resp] C-L or T-E

diff --git a/bin/varnishtest/tests/b00037.vtc b/bin/varnishtest/tests/b00037.vtc
index 63d8014dc..ce0e84112 100644
--- a/bin/varnishtest/tests/b00037.vtc
+++ b/bin/varnishtest/tests/b00037.vtc
@@ -13,7 +13,7 @@ varnish v1 -vsl_catchup
 varnish v1 -expect client_req_400 == 1
 
 client c1 {
-	txreq -method POST -hdr "Content-Length: 12" -bodylen 12
+	txreq -method POST -hdr "Content-Length: 12" -hdr "Content-Length: 12" -bodylen 12
 	rxresp
 	expect resp.status == 400
 } -run
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 827c20da4..aada58c03 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -786,6 +786,9 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
 		} else if (!strcmp(*av, "-nohost")) {
 			nohost = 1;
 		} else if (!strcmp(*av, "-hdr")) {
+			if (!strncasecmp(av[1], "Content-Length:", 15) ||
+			    !strncasecmp(av[1], "Transfer-Encoding:", 18))
+				nolen = 1;
 			if (!strncasecmp(av[1], "Host:", 5))
 				nohost = 1;
 			VSB_printf(hp->vsb, "%s%s", av[1], nl);


More information about the varnish-commit mailing list