[master] 610cbd9 Add a few more variants
Federico G. Schwindt
fgsch at lodoss.net
Wed Jan 20 18:24:37 CET 2016
commit 610cbd9323f8e06eaf76627c56862076fc251096
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Wed Jan 20 17:06:52 2016 +0000
Add a few more variants
Prompted by #1845. I'm not entirely sure whether some literals like
"1.00 " should be accepted but that's the current behaviour.
diff --git a/bin/varnishtest/tests/m00015.vtc b/bin/varnishtest/tests/m00015.vtc
index 077bbaf..a5ec8ba 100644
--- a/bin/varnishtest/tests/m00015.vtc
+++ b/bin/varnishtest/tests/m00015.vtc
@@ -9,15 +9,27 @@ varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
- set resp.http.x-real = std.real(req.http.foo, 0.0);
- set resp.http.x-fallback = std.real(req.http.bar, 0.0);
+ set resp.http.t0 = std.real(req.http.foo, 0.0);
+ set resp.http.t1 = std.real(req.http.bar, 0.0);
+ set resp.http.t2 = std.real(req.http.nonexistent, 0.0);
+ set resp.http.t3 = std.real("1.", 0.0);
+ set resp.http.t4 = std.real("1.0", 0.0);
+ set resp.http.t5 = std.real("1.0 ", 0.0);
+ set resp.http.t6 = std.real(" 1.0", 0.0);
+ set resp.http.t7 = std.real(" 1.0 ", 0.0);
}
} -start
client c1 {
- txreq -hdr "foo: 1.00"
+ txreq -hdr "foo: 1.00" -hdr "bar: 1.00a"
rxresp
expect resp.status == 200
- expect resp.http.x-real == 1.000
- expect resp.http.x-fallback == 0.000
+ expect resp.http.t0 == 1.000
+ expect resp.http.t1 == 0.000
+ expect resp.http.t2 == 0.000
+ expect resp.http.t3 == 1.000
+ expect resp.http.t4 == 1.000
+ expect resp.http.t5 == 1.000
+ expect resp.http.t6 == 1.000
+ expect resp.http.t7 == 1.000
} -run
More information about the varnish-commit
mailing list