[master] 29fb693 Misc. nit-pickery related to Content-Length
Poul-Henning Kamp
phk at FreeBSD.org
Tue Sep 15 15:02:15 CEST 2015
commit 29fb693a47d9e7332a11f864aa132047225b35ea
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Sep 15 12:51:37 2015 +0000
Misc. nit-pickery related to Content-Length
diff --git a/bin/varnishtest/tests/b00020.vtc b/bin/varnishtest/tests/b00020.vtc
index 548b281..1174cd5 100644
--- a/bin/varnishtest/tests/b00020.vtc
+++ b/bin/varnishtest/tests/b00020.vtc
@@ -30,7 +30,7 @@ varnish v1 -expect n_objectcore == 0
server s1 -wait {
non-fatal
rxreq
- send "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n"
+ send "HTTP/1.0 200 OK\r\nConnection: close\r\n\r\n"
delay 0.5
send "Baba\n"
delay 0.5
@@ -41,6 +41,7 @@ client c1 {
txreq
rxresp
expect resp.status == 200
+ expect resp.bodylen == 10
} -run
varnish v1 -expect n_object == 1
diff --git a/bin/varnishtest/tests/c00008.vtc b/bin/varnishtest/tests/c00008.vtc
index a654962..690b362 100644
--- a/bin/varnishtest/tests/c00008.vtc
+++ b/bin/varnishtest/tests/c00008.vtc
@@ -15,25 +15,32 @@ client c1 {
rxresp
expect resp.status == 200
expect resp.http.etag == {"foo"}
+ expect resp.http.content-length == "6"
expect resp.bodylen == 6
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT"
rxresp
expect resp.status == 200
+ expect resp.http.content-length == "6"
expect resp.http.etag == {"foo"}
+ expect resp.bodylen == 6
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT"
rxresp -no_obj
expect resp.status == 304
expect resp.http.etag == {"foo"}
+ expect resp.http.content-length == "<undef>"
+ expect resp.bodylen == "<undef>"
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:02 GMT"
rxresp -no_obj
expect resp.status == 304
expect resp.http.etag == {"foo"}
+ expect resp.http.content-length == "<undef>"
+ expect resp.bodylen == "<undef>"
}
client c1 -run
diff --git a/bin/varnishtest/tests/e00013.vtc b/bin/varnishtest/tests/e00013.vtc
index d6db08c..bf3ca8d 100644
--- a/bin/varnishtest/tests/e00013.vtc
+++ b/bin/varnishtest/tests/e00013.vtc
@@ -3,8 +3,9 @@ varnishtest "All white-space object, in multiple storage segments"
server s1 {
rxreq
expect req.url == "/foo"
- txresp -nolen -hdr "Connection: close"
- send {<x> }
+ txresp -nolen -hdr "Transfer-Encoding: chunked"
+ chunked {<x> }
+ chunkedlen 0
} -start
varnish v1 -vcl+backend {
diff --git a/bin/varnishtest/tests/r00730.vtc b/bin/varnishtest/tests/r00730.vtc
index 67b9598..e28c8c9 100644
--- a/bin/varnishtest/tests/r00730.vtc
+++ b/bin/varnishtest/tests/r00730.vtc
@@ -1,4 +1,4 @@
-varnishtest "Check that HEAD returns Content-Length: if backend provides"
+varnishtest "Check that HEAD returns Content-Length if backend provides it"
server s1 {
rxreq
@@ -8,6 +8,11 @@ server s1 {
} -start
varnish v1 -vcl+backend {
+ sub vcl_recv {
+ if (req.url == "/2") {
+ return (pass);
+ }
+ }
sub vcl_backend_response {
set beresp.do_stream = false;
}
@@ -19,18 +24,8 @@ client c1 {
expect resp.http.content-length == 5
} -run
-
-varnish v1 -vcl+backend {
- sub vcl_recv {
- return (pass);
- }
- sub vcl_backend_response {
- set beresp.do_stream = false;
- }
-}
-
client c1 {
- txreq -req HEAD
+ txreq -req HEAD -url /2
rxresp -no_obj
expect resp.http.content-length == 6
} -run
diff --git a/bin/varnishtest/tests/r01404.vtc b/bin/varnishtest/tests/r01404.vtc
index 1c04139..b9d453b 100644
--- a/bin/varnishtest/tests/r01404.vtc
+++ b/bin/varnishtest/tests/r01404.vtc
@@ -5,11 +5,7 @@ server s1 {
txresp -hdr {ETag: "foo"} -body "11111\n"
} -start
-varnish v1 -vcl+backend {
- sub vcl_backend_response {
- set beresp.do_stream = true;
- }
-} -start
+varnish v1 -vcl+backend { } -start
client c1 {
txreq -hdr {If-None-Match: "foo"}
More information about the varnish-commit
mailing list