[master] 4c9b521 Quote etags used in tests.
Nils Goroll
nils.goroll at uplex.de
Wed Aug 13 10:40:32 CEST 2014
commit 4c9b521badf0f8d5f856bf654fde7215d43336fc
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Aug 12 13:04:03 2014 +0200
Quote etags used in tests.
Though unquoted Etags are commonly seen in the wild, according to rfc2616
the entity-tag itself should be quoted.
diff --git a/bin/varnishtest/tests/c00008.vtc b/bin/varnishtest/tests/c00008.vtc
index 64762f6..09535c9 100644
--- a/bin/varnishtest/tests/c00008.vtc
+++ b/bin/varnishtest/tests/c00008.vtc
@@ -4,7 +4,7 @@ server s1 {
rxreq
expect req.url == "/foo"
txresp -hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \
- -hdr "ETag: foo" \
+ -hdr {ETag: "foo"} \
-body "11111\n"
} -start
@@ -14,26 +14,26 @@ client c1 {
txreq -url "/foo"
rxresp
expect resp.status == 200
- expect resp.http.etag == "foo"
+ expect resp.http.etag == {"foo"}
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.etag == "foo"
+ expect resp.http.etag == {"foo"}
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.etag == {"foo"}
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.etag == {"foo"}
}
client c1 -run
diff --git a/bin/varnishtest/tests/c00025.vtc b/bin/varnishtest/tests/c00025.vtc
index d1a55f3..ea0866a 100644
--- a/bin/varnishtest/tests/c00025.vtc
+++ b/bin/varnishtest/tests/c00025.vtc
@@ -3,7 +3,7 @@ varnishtest "Test If-None-Match"
server s1 {
rxreq
expect req.url == "/foo"
- txresp -hdr "ETag: 123456789" \
+ txresp -hdr {ETag: "123456789"} \
-body "11111\n"
} -start
@@ -16,12 +16,12 @@ client c1 {
expect resp.bodylen == 6
txreq -url "/foo" \
- -hdr "If-None-Match: 12345678"
+ -hdr {If-None-Match: "12345678"}
rxresp
expect resp.status == 200
txreq -url "/foo" \
- -hdr "If-None-Match: 123456789"
+ -hdr {If-None-Match: "123456789"}
rxresp -no_obj
expect resp.status == 304
}
diff --git a/bin/varnishtest/tests/c00026.vtc b/bin/varnishtest/tests/c00026.vtc
index 7d5c32c..7840b48 100644
--- a/bin/varnishtest/tests/c00026.vtc
+++ b/bin/varnishtest/tests/c00026.vtc
@@ -3,7 +3,7 @@ varnishtest "Test Combination of If-None-Match and If-Modified-Since"
server s1 {
rxreq
expect req.url == "/foo"
- txresp -hdr "ETag: 123456789" \
+ txresp -hdr {ETag: "123456789"} \
-hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \
-body "11111\n"
} -start
@@ -17,7 +17,7 @@ client c1 {
expect resp.bodylen == 6
txreq -url "/foo" \
- -hdr "If-None-Match: 123456789"
+ -hdr {If-None-Match: "123456789"}
rxresp -no_obj
expect resp.status == 304
@@ -28,19 +28,19 @@ client c1 {
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:00 GMT" \
- -hdr "If-None-Match: 123456789"
+ -hdr {If-None-Match: "123456789"}
rxresp
expect resp.status == 200
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \
- -hdr "If-None-Match: 12345678"
+ -hdr {If-None-Match: "12345678"}
rxresp
expect resp.status == 200
txreq -url "/foo" \
-hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT" \
- -hdr "If-None-Match: 123456789"
+ -hdr {If-None-Match: "123456789"}
rxresp -no_obj
expect resp.status == 304
diff --git a/bin/varnishtest/tests/g00006.vtc b/bin/varnishtest/tests/g00006.vtc
index cbae574..2400401 100644
--- a/bin/varnishtest/tests/g00006.vtc
+++ b/bin/varnishtest/tests/g00006.vtc
@@ -4,27 +4,27 @@ server s1 {
rxreq
expect req.url == /1
txresp -hdr "Last-Modified: Wed, 11 Sep 2013 13:36:55 GMT" \
- -hdr "ETag: foozle" \
+ -hdr {ETag: "foozle"} \
-bodylen 20
rxreq
expect req.url == /1
expect req.http.if-modified-since == "Wed, 11 Sep 2013 13:36:55 GMT"
txresp -status 304 \
- -hdr "ETag: fizle" \
+ -hdr {ETag: "fizle"} \
-nolen
rxreq
expect req.url == /2
txresp -hdr "Last-Modified: Wed, 11 Sep 2013 13:36:55 GMT" \
- -hdr "ETag: foobar" \
+ -hdr {ETag: "foobar"} \
-gzipbody "012345678901234567"
rxreq
expect req.url == /2
expect req.http.if-modified-since == "Wed, 11 Sep 2013 13:36:55 GMT"
txresp -status 304 -hdr "Content-Encoding: gzip,rot13" \
- -hdr "ETag: snafu" \
+ -hdr {ETag: "snafu"} \
-nolen
} -start
@@ -48,7 +48,7 @@ client c1 {
rxresp
expect resp.http.content-encoding == "gzip"
expect resp.http.foobar == ""
- expect resp.http.etag == "W/foozle"
+ expect resp.http.etag == {W/"foozle"}
gunzip
expect resp.bodylen == 20
@@ -58,7 +58,7 @@ client c1 {
rxresp
expect resp.http.content-encoding == "gzip"
expect resp.http.foobar == "gzip"
- expect resp.http.etag == "W/fizle"
+ expect resp.http.etag == {W/"fizle"}
gunzip
expect resp.bodylen == 20
@@ -69,7 +69,7 @@ client c1 {
expect resp.http.content-encoding == "<undef>"
expect resp.http.foobar == "gzip"
expect resp.bodylen == 18
- expect resp.http.etag == "W/foobar"
+ expect resp.http.etag == {W/"foobar"}
delay 1
@@ -78,7 +78,7 @@ client c1 {
expect resp.http.content-encoding == "<undef>"
# Here we see the C-E of the IMS OBJ
expect resp.http.foobar == ""
- expect resp.http.etag == "W/snafu"
+ expect resp.http.etag == {W/"snafu"}
expect resp.bodylen == 18
} -run
diff --git a/bin/varnishtest/tests/r00907.vtc b/bin/varnishtest/tests/r00907.vtc
index 8bb1139..4bd767f 100644
--- a/bin/varnishtest/tests/r00907.vtc
+++ b/bin/varnishtest/tests/r00907.vtc
@@ -3,7 +3,7 @@ varnishtest "Ticket #907 200/304 handling with Etags + Last-Modified"
server s1 {
rxreq
txresp \
- -hdr "ETag: saengei1Ohshicich4iteesu" \
+ -hdr {ETag: "saengei1Ohshicich4iteesu"} \
-hdr "Last-Modified: Tue, 20 Sep 2011 18:55:00 GMT"
} -start
@@ -14,16 +14,16 @@ varnish v1 -vcl+backend {
} -start
client c1 {
- txreq -hdr "If-None-Match: saengei1Ohshicich4iteesu"
+ txreq -hdr {If-None-Match: "saengei1Ohshicich4iteesu"}
rxresp -no_obj
expect resp.status == 304
- txreq -hdr "If-None-Match: saengei1Ohshicich4iteesu" \
+ txreq -hdr {If-None-Match: "saengei1Ohshicich4iteesu"} \
-hdr "If-Modified-Since: Tue, 20 Sep 2011 18:54:59 GMT"
rxresp -no_obj
expect resp.status == 200
- txreq -hdr "If-None-Match: saengei1Ohshicich4iteesu" \
+ txreq -hdr {If-None-Match: "saengei1Ohshicich4iteesu"} \
-hdr "If-Modified-Since: Tue, 20 Sep 2011 18:55:00 GMT"
rxresp -no_obj
expect resp.status == 304
diff --git a/bin/varnishtest/tests/r00972.vtc b/bin/varnishtest/tests/r00972.vtc
index d5e0f0e..0b173f2 100644
--- a/bin/varnishtest/tests/r00972.vtc
+++ b/bin/varnishtest/tests/r00972.vtc
@@ -2,7 +2,7 @@ varnishtest "Test conditional delivery and do_stream"
server s1 {
rxreq
- txresp -hdr "ETag: foo" -body "11111\n"
+ txresp -hdr {ETag: "foo"} -body "11111\n"
} -start
varnish v1 -vcl+backend {
@@ -12,9 +12,9 @@ varnish v1 -vcl+backend {
} -start
client c1 {
- txreq -hdr "If-None-Match: foo"
+ txreq -hdr {If-None-Match: "foo"}
rxresp -no_obj
expect resp.status == 304
- expect resp.http.etag == "foo"
+ expect resp.http.etag == {"foo"}
} -run
diff --git a/bin/varnishtest/tests/r01206.vtc b/bin/varnishtest/tests/r01206.vtc
index 78e00b4..1ceb85f 100644
--- a/bin/varnishtest/tests/r01206.vtc
+++ b/bin/varnishtest/tests/r01206.vtc
@@ -5,7 +5,7 @@ server s1 {
txresp -bodylen 6
rxreq
- txresp -hdr "ETag: 123456789" \
+ txresp -hdr {ETag: "123456789"} \
-bodylen 7
rxreq
@@ -25,7 +25,7 @@ client c1 {
expect resp.status == 200
expect resp.bodylen == 6
- txreq -hdr "If-None-Match: 123456789"
+ txreq -hdr {If-None-Match: "123456789"}
rxresp
expect resp.status == 200
expect resp.bodylen == 7
diff --git a/bin/varnishtest/tests/r01404.vtc b/bin/varnishtest/tests/r01404.vtc
index 1411a00..1c04139 100644
--- a/bin/varnishtest/tests/r01404.vtc
+++ b/bin/varnishtest/tests/r01404.vtc
@@ -2,7 +2,7 @@ varnishtest "Test that 304 does not send Content-Length"
server s1 {
rxreq
- txresp -hdr "ETag: foo" -body "11111\n"
+ txresp -hdr {ETag: "foo"} -body "11111\n"
} -start
varnish v1 -vcl+backend {
@@ -12,7 +12,7 @@ varnish v1 -vcl+backend {
} -start
client c1 {
- txreq -hdr "If-None-Match: foo"
+ txreq -hdr {If-None-Match: "foo"}
rxresp -no_obj
expect resp.status == 304
expect resp.http.Content-Length == <undef>
diff --git a/bin/varnishtest/tests/r01485.vtc b/bin/varnishtest/tests/r01485.vtc
index caf267a..abfe839 100644
--- a/bin/varnishtest/tests/r01485.vtc
+++ b/bin/varnishtest/tests/r01485.vtc
@@ -2,10 +2,10 @@ varnishtest "#1485: Wrong response reason phrase"
server s1 {
rxreq
- txresp -hdr "Etag: foo"
+ txresp -hdr {Etag: "foo"}
rxreq
- expect req.http.If-None-Match == "foo"
+ expect req.http.If-None-Match == {"foo"}
txresp -status 304 -msg "Not Modified"
} -start
diff --git a/bin/varnishtest/tests/r01499.vtc b/bin/varnishtest/tests/r01499.vtc
index 7b438b2..fb9ec15 100644
--- a/bin/varnishtest/tests/r01499.vtc
+++ b/bin/varnishtest/tests/r01499.vtc
@@ -2,9 +2,9 @@ varnishtest "#1499 - objcore ref leak on IMS update"
server s1 {
rxreq
- txresp -hdr "Etag: foo"
+ txresp -hdr {Etag: "foo"}
rxreq
- expect req.http.if-none-match == "foo"
+ expect req.http.if-none-match == {"foo"}
txresp -hdr "X-Resp: 2"
} -start
diff --git a/bin/varnishtest/tests/v00024.vtc b/bin/varnishtest/tests/v00024.vtc
index e502eee..71b13f8 100644
--- a/bin/varnishtest/tests/v00024.vtc
+++ b/bin/varnishtest/tests/v00024.vtc
@@ -19,7 +19,7 @@ client c1 {
rxresp
expect resp.status == 200
expect resp.bodylen == 1
- txreq -url "/foo" -hdr "etag: foo" -hdr "if-none-match: foo"
+ txreq -url "/foo" -hdr {etag: "foo"} -hdr {if-none-match: "foo"}
rxresp
expect resp.status == 400
} -run
More information about the varnish-commit
mailing list