[6.2] af13de03e Add a test case covering some HTTP/1 parsing corner cases

Martin Blix Grydeland martin at varnish-software.com
Tue Sep 3 10:06:05 UTC 2019


commit af13de03eaa3d04f60ada52ed3235d545b8d3973
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Thu Aug 15 14:06:00 2019 +0200

    Add a test case covering some HTTP/1 parsing corner cases

diff --git a/bin/varnishtest/tests/b00069.vtc b/bin/varnishtest/tests/b00069.vtc
new file mode 100644
index 000000000..2167c9483
--- /dev/null
+++ b/bin/varnishtest/tests/b00069.vtc
@@ -0,0 +1,29 @@
+varnishtest "HTTP/1 parsing checks"
+
+# Some tricky requests that have been known to cause parsing errors in the past.
+
+server s1 {
+	rxreq
+	txresp
+} -start
+
+varnish v1 -vcl+backend {
+} -start
+
+# This test checks a bug that was dependent on the contents of the buffer left behind
+# by the previous request
+client c1 {
+	send "GET / HTTP/1.1\r\nHost: asdf.com\r\nFoo: baar\r\n\r\n\r\n\r\n\r\n"
+	rxresp
+	send "GET / HTTP/1.1\r\nHost: asdf.com\r\nAsdf: b\n \r\n\r\nSj\r"
+	rxresp
+	expect resp.status == 200
+} -run
+
+# This tests that the line continuation handling doesn't clear out the end of headers
+# [CR]LF
+client c1 {
+	send "GET / HTTP/1.1\r\nHost: asdf.com\r\nAsdf: b\n \r\n\r\nSj"
+	rxresp
+	expect resp.status == 200
+} -run


More information about the varnish-commit mailing list