Mailing List Archive

[master] 3fc690dfc Add test case for 304 response on zero-sized object
commit 3fc690dfc6c81ac2d9e96768bbe0516e8c67b75f
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Mon Dec 4 11:30:24 2023 +0100

Add test case for 304 response on zero-sized object

Test case by Martin Blix Grydeland, taken from #4013

diff --git a/bin/varnishtest/tests/b000082.vtc b/bin/varnishtest/tests/b000082.vtc
new file mode 100644
index 000000000..8b659a913
--- /dev/null
+++ b/bin/varnishtest/tests/b000082.vtc
@@ -0,0 +1,39 @@
+varnishtest "Backend IMS 304 reponse with Content-Length 0"
+
+# this case tests invalid behaviour, which we should handle gracefully anyway
+
+server s1 {
+ rxreq
+ txresp -nolen -hdr "Content-Length: 0" -hdr {Etag: "foo"}
+
+ rxreq
+ txresp -status 304 -nolen -hdr "Content-Length: 0" -hdr {Etag: "foo"}
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_backend_response {
+ set beresp.ttl = 1s;
+ }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+
+ txreq
+ rxresp
+} -run
+
+delay 1
+
+client c2 {
+ txreq
+ rxresp
+} -run
+
+delay 0.1
+
+client c3 {
+ txreq
+ rxresp
+} -run
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit