[5.2] 729f4b1 Whitespace OCD
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Thu Sep 7 06:59:07 UTC 2017
commit 729f4b152c42e38c6d6cdb33b2b515effb43c2c3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Sep 5 10:48:40 2017 +0000
Whitespace OCD
diff --git a/bin/varnishtest/tests/m00033.vtc b/bin/varnishtest/tests/m00033.vtc
index 11f36e6..cb15b5e 100644
--- a/bin/varnishtest/tests/m00033.vtc
+++ b/bin/varnishtest/tests/m00033.vtc
@@ -51,7 +51,7 @@ varnish v1 -vcl {
decoding=IDENTITY));
set resp.http.truncated =
- blob.encode(IDENTITY, blob.decode(HEX, "666f6f00626172"));
+ blob.encode(IDENTITY, blob.decode(HEX, "666f6f00626172"));
}
} -start
diff --git a/bin/varnishtest/tests/m00035.vtc b/bin/varnishtest/tests/m00035.vtc
index 2dca6f3..b26d151 100644
--- a/bin/varnishtest/tests/m00035.vtc
+++ b/bin/varnishtest/tests/m00035.vtc
@@ -19,26 +19,26 @@ varnish v1 -arg "-p workspace_client=256k" -vcl {
{"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="};
set resp.http.hexlc =
- blob.encode(HEXLC,
+ blob.encode(HEXLC,
blob.decode(IDENTITY, req.http.pangram));
set resp.http.hexuc =
- blob.encode(HEXUC,
+ blob.encode(HEXUC,
blob.decode(IDENTITY, req.http.pangram));
- set resp.http.hobbeslc =
+ set resp.http.hobbeslc =
blob.encode(HEXLC, blob.decode(IDENTITY, req.http.hobbes));
set resp.http.hobbesuc =
blob.encode(HEXUC, blob.decode(IDENTITY, req.http.hobbes));
- set resp.http.all-lc =
+ set resp.http.all-lc =
blob.encode(HEXLC, blob.decode(BASE64, req.http.b64all));
set resp.http.all-uc =
blob.encode(HEXUC, blob.decode(BASE64, req.http.b64all));
- set resp.http.empty-lc =
+ set resp.http.empty-lc =
blob.encode(HEXLC, blob.decode(IDENTITY, ""));
set resp.http.empty-uc =
@@ -55,41 +55,41 @@ varnish v1 -arg "-p workspace_client=256k" -vcl {
set req.http.hexucfoobar = "666F6F206261722062617A2071757578";
set req.http.hexlcfoobar = std.tolower(req.http.hexucfoobar);
# Hobbes quotation in hex
- set req.http.hexhobbeslc = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
+ set req.http.hexhobbeslc = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
set req.http.hexhobbesuc = std.toupper(req.http.hexhobbeslc);
- set req.http.hexalluc = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF";
+ set req.http.hexalluc = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF";
set req.http.hexalllc = std.tolower(req.http.hexalluc);
- set req.http.hexallucodd = regsub(req.http.hexalluc, "^0", "");
- set req.http.hexalllcodd = regsub(req.http.hexalllc, "^0", "");
+ set req.http.hexallucodd = regsub(req.http.hexalluc, "^0", "");
+ set req.http.hexalllcodd = regsub(req.http.hexalllc, "^0", "");
set resp.http.decuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(HEX, req.http.hexucfoobar));
set resp.http.declc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(HEX, req.http.hexlcfoobar));
set resp.http.dechobbesuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(HEX, req.http.hexhobbesuc));
set resp.http.dechobbeslc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(HEX, req.http.hexhobbeslc));
set resp.http.decalluc =
- blob.encode(BASE64, blob.decode(HEX, req.http.hexalluc));
+ blob.encode(BASE64, blob.decode(HEX, req.http.hexalluc));
set resp.http.decalllc =
- blob.encode(BASE64, blob.decode(HEX, req.http.hexalllc));
+ blob.encode(BASE64, blob.decode(HEX, req.http.hexalllc));
set resp.http.decallucodd =
- blob.encode(BASE64, blob.decode(HEX,
+ blob.encode(BASE64, blob.decode(HEX,
req.http.hexallucodd));
set resp.http.decalllcodd =
- blob.encode(BASE64, blob.decode(HEX,
+ blob.encode(BASE64, blob.decode(HEX,
req.http.hexalllcodd));
set resp.http.decempty =
@@ -102,7 +102,7 @@ varnish v1 -arg "-p workspace_client=256k" -vcl {
blob.encode(IDENTITY, blob.decode(HEX, "0"));
set resp.http.decemptypieces =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(HEX, req.http.unset + ""
+ req.http.unset + ""));
@@ -123,7 +123,7 @@ varnish v1 -arg "-p workspace_client=256k" -vcl {
"F6F206261722062617A20717" + req.http.part2));
set resp.http.decmanypieces =
- blob.encode(IDENTITY, blob.decode(HEX, "" + req.http.unset
+ blob.encode(IDENTITY, blob.decode(HEX, "" + req.http.unset
+ req.http.part1 + req.http.unset + ""
+ req.http.unset + "" + "F6F206261722062617A20717"
+ "" + req.http.unset + req.http.part2
@@ -188,8 +188,8 @@ client c1 {
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
- expect 0 * Begin req
- expect * = VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"g\"$"
+ expect 0 * Begin req
+ expect * = VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"g\"$"
#"
expect * = End
} -start
diff --git a/bin/varnishtest/tests/m00036.vtc b/bin/varnishtest/tests/m00036.vtc
index 88f869a..21ff627 100644
--- a/bin/varnishtest/tests/m00036.vtc
+++ b/bin/varnishtest/tests/m00036.vtc
@@ -18,26 +18,26 @@ varnish v1 -vcl {
{"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="};
set resp.http.hexlc =
- blob.encode(HEXLC,
+ blob.encode(HEXLC,
blob.decode_n(5, IDENTITY, req.http.pangram));
set resp.http.hexuc =
- blob.encode(HEXUC,
+ blob.encode(HEXUC,
blob.decode_n(5, IDENTITY, req.http.pangram));
- set resp.http.hobbeslc =
+ set resp.http.hobbeslc =
blob.encode(HEXLC, blob.decode_n(5, IDENTITY, req.http.hobbes));
set resp.http.hobbesuc =
blob.encode(HEXUC, blob.decode_n(5, IDENTITY, req.http.hobbes));
- set resp.http.all-lc =
+ set resp.http.all-lc =
blob.encode(HEXLC, blob.decode_n(8, BASE64, req.http.b64all));
set resp.http.all-uc =
blob.encode(HEXUC, blob.decode_n(8, BASE64, req.http.b64all));
- set resp.http.empty-lc =
+ set resp.http.empty-lc =
blob.encode(HEXLC, blob.decode_n(5, IDENTITY, ""));
set resp.http.empty-uc =
@@ -54,41 +54,41 @@ varnish v1 -vcl {
set req.http.hexucfoobar = "666F6F206261722062617A2071757578";
set req.http.hexlcfoobar = std.tolower(req.http.hexucfoobar);
# Hobbes quotation in hex
- set req.http.hexhobbeslc = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
+ set req.http.hexhobbeslc = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
set req.http.hexhobbesuc = std.toupper(req.http.hexhobbeslc);
- set req.http.hexalluc = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF";
+ set req.http.hexalluc = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF";
set req.http.hexalllc = std.tolower(req.http.hexalluc);
- set req.http.hexallucodd = regsub(req.http.hexalluc, "^0", "");
- set req.http.hexalllcodd = regsub(req.http.hexalllc, "^0", "");
+ set req.http.hexallucodd = regsub(req.http.hexalluc, "^0", "");
+ set req.http.hexalllcodd = regsub(req.http.hexalllc, "^0", "");
set resp.http.decuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(10, HEX, req.http.hexucfoobar));
set resp.http.declc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(10, HEX, req.http.hexlcfoobar));
set resp.http.dechobbesuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(12, HEX, req.http.hexhobbesuc));
set resp.http.dechobbeslc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(12, HEX, req.http.hexhobbeslc));
set resp.http.decalluc =
- blob.encode(BASE64, blob.decode_n(12, HEX, req.http.hexalluc));
+ blob.encode(BASE64, blob.decode_n(12, HEX, req.http.hexalluc));
set resp.http.decalllc =
- blob.encode(BASE64, blob.decode_n(12, HEX, req.http.hexalllc));
+ blob.encode(BASE64, blob.decode_n(12, HEX, req.http.hexalllc));
set resp.http.decallucodd =
- blob.encode(BASE64, blob.decode_n(11, HEX,
+ blob.encode(BASE64, blob.decode_n(11, HEX,
req.http.hexallucodd));
set resp.http.decalllcodd =
- blob.encode(BASE64, blob.decode_n(11, HEX,
+ blob.encode(BASE64, blob.decode_n(11, HEX,
req.http.hexalllcodd));
set resp.http.decempty =
@@ -101,7 +101,7 @@ varnish v1 -vcl {
blob.encode(IDENTITY, blob.decode_n(2, HEX, "0"));
set resp.http.decemptypieces =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(5, HEX, req.http.unset + ""
+ req.http.unset + ""));
@@ -122,7 +122,7 @@ varnish v1 -vcl {
"F6F206261722062617A20717" + req.http.part2));
set resp.http.decmanypieces =
- blob.encode(IDENTITY, blob.decode_n(20, HEX, "" + req.http.unset
+ blob.encode(IDENTITY, blob.decode_n(20, HEX, "" + req.http.unset
+ req.http.part1 + req.http.unset + ""
+ req.http.unset + "" + "F6F206261722062617A20717"
+ "" + req.http.unset + req.http.part2
@@ -187,8 +187,8 @@ client c1 {
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
- expect 0 * Begin req
- expect * = VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"g\"$"
+ expect 0 * Begin req
+ expect * = VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"g\"$"
#"
expect * = End
} -start
diff --git a/bin/varnishtest/tests/m00037.vtc b/bin/varnishtest/tests/m00037.vtc
index 29bde50..13dc2d5 100644
--- a/bin/varnishtest/tests/m00037.vtc
+++ b/bin/varnishtest/tests/m00037.vtc
@@ -18,37 +18,37 @@ varnish v1 -vcl {
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"};
set resp.http.b64 =
- blob.encode(BASE64, blob.decode(IDENTITY,
+ blob.encode(BASE64, blob.decode(IDENTITY,
req.http.pangram));
set resp.http.b64hobbes =
- blob.encode(BASE64, blob.decode(IDENTITY,
+ blob.encode(BASE64, blob.decode(IDENTITY,
req.http.hobbes));
set resp.http.b64all =
blob.encode(BASE64, blob.decode(HEX, req.http.hexall));
set resp.http.b64url =
- blob.encode(BASE64URL,
+ blob.encode(BASE64URL,
blob.decode(IDENTITY, req.http.pangram));
set resp.http.b64urlhobbes =
- blob.encode(BASE64URL,
+ blob.encode(BASE64URL,
blob.decode(IDENTITY, req.http.hobbes));
set resp.http.b64urlall =
blob.encode(BASE64URL, blob.decode(HEX, req.http.hexall));
set resp.http.b64urlnopad =
- blob.encode(BASE64URLNOPAD,
+ blob.encode(BASE64URLNOPAD,
blob.decode(IDENTITY, req.http.pangram));
set resp.http.b64nopadhobbes =
- blob.encode(BASE64URLNOPAD,
+ blob.encode(BASE64URLNOPAD,
blob.decode(IDENTITY, req.http.hobbes));
set resp.http.b64nopadall =
- blob.encode(BASE64URLNOPAD,
+ blob.encode(BASE64URLNOPAD,
blob.decode(HEX, req.http.hexall));
set resp.http.b64empty =
@@ -134,26 +134,26 @@ varnish v1 -vcl {
blob.decode(BASE64, req.http.pangram));
set resp.http.b64dechobbes =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(BASE64, req.http.hobbes));
set resp.http.b64decall =
blob.encode(HEXLC, blob.decode(BASE64, req.http.all));
set resp.http.urldechobbes =
- blob.encode(IDENTITY, blob.decode(BASE64URL,
+ blob.encode(IDENTITY, blob.decode(BASE64URL,
req.http.hobbes));
set resp.http.urldecall =
- blob.encode(HEXLC,
+ blob.encode(HEXLC,
blob.decode(BASE64URL, req.http.allurl));
set resp.http.nopaddechobbes =
- blob.encode(IDENTITY, blob.decode(BASE64URLNOPAD,
+ blob.encode(IDENTITY, blob.decode(BASE64URLNOPAD,
req.http.hobbesnopad));
set resp.http.nopaddecall =
- blob.encode(HEXLC,
+ blob.encode(HEXLC,
blob.decode(BASE64URLNOPAD, req.http.allurl));
set resp.http.b64empty =
@@ -167,34 +167,34 @@ varnish v1 -vcl {
blob.decode(BASE64, req.http.unset + "" + req.http.unset
+ "" + req.http.unset + ""));
- set resp.http.decenc
+ set resp.http.decenc
= blob.encode(BASE64,
blob.decode(BASE64, req.http.foobarbazquux));
set resp.http.l = "L";
set resp.http.dec2pieces
= blob.encode(IDENTITY, blob.decode(BASE64,
- resp.http.l + "0hlbGxvIHdvcmxkLw=="));
+ resp.http.l + "0hlbGxvIHdvcmxkLw=="));
set resp.http.pad = "==";
set resp.http.dec3pieces
= blob.encode(IDENTITY, blob.decode(BASE64,
- resp.http.l + "0hlbGxvIHdvcmxkLw"
- + resp.http.pad));
+ resp.http.l + "0hlbGxvIHdvcmxkLw"
+ + resp.http.pad));
set resp.http.mid1 = "GxvI";
set resp.http.mid2 = "dvcmx";
set resp.http.dec7pieces
= blob.encode(IDENTITY, blob.decode(BASE64,
- resp.http.l + "0hlb" + resp.http.mid1
- + "H" + resp.http.mid2 + "kLw"
- + resp.http.pad));
+ resp.http.l + "0hlb" + resp.http.mid1
+ + "H" + resp.http.mid2 + "kLw"
+ + resp.http.pad));
set resp.http.dec7param
= blob.encode(blob=blob.decode(encoded=resp.http.l + "0hlb"
- + resp.http.mid1 + "H" + resp.http.mid2 + "kLw"
- + resp.http.pad, decoding=BASE64),
- encoding=IDENTITY);
+ + resp.http.mid1 + "H" + resp.http.mid2 + "kLw"
+ + resp.http.pad, decoding=BASE64),
+ encoding=IDENTITY);
set resp.http.decnopad = blob.encode(IDENTITY,
blob.decode(BASE64URLNOPAD,
@@ -202,17 +202,17 @@ varnish v1 -vcl {
set resp.http.decnopad2pieces
= blob.encode(IDENTITY, blob.decode(BASE64URLNOPAD,
- resp.http.l + "0hlbGxvIHdvcmxkLw"));
+ resp.http.l + "0hlbGxvIHdvcmxkLw"));
set resp.http.decnopad6pieces
= blob.encode(IDENTITY, blob.decode(BASE64URLNOPAD,
- resp.http.l + "0hlb" + resp.http.mid1
- + "H" + resp.http.mid2 + "kLw"));
+ resp.http.l + "0hlb" + resp.http.mid1
+ + "H" + resp.http.mid2 + "kLw"));
set resp.http.decnopadlong
= blob.encode(IDENTITY,
blob.decode(BASE64URLNOPAD,
- "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw"
+ "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw"
));
}
@@ -255,19 +255,19 @@ varnish v1 -vcl+backend {
import blob;
sub vcl_deliver {
- set req.http.foo = "AAA=";
- if (req.url == "/base64") {
- set resp.http.bad64 = blob.encode(IDENTITY,
- blob.decode(BASE64, "-_-_" + req.http.foo));
- }
- elsif (req.url == "/base64url") {
- set resp.http.badurl = blob.encode(IDENTITY,
- blob.decode(BASE64URL, "+/+/" + req.http.foo));
- }
- elsif (req.url == "/base64urlnopad") {
- set resp.http.badpad = blob.encode(IDENTITY,
- blob.decode(BASE64URLNOPAD, "TWFu" + req.http.foo));
- }
+ set req.http.foo = "AAA=";
+ if (req.url == "/base64") {
+ set resp.http.bad64 = blob.encode(IDENTITY,
+ blob.decode(BASE64, "-_-_" + req.http.foo));
+ }
+ elsif (req.url == "/base64url") {
+ set resp.http.badurl = blob.encode(IDENTITY,
+ blob.decode(BASE64URL, "+/+/" + req.http.foo));
+ }
+ elsif (req.url == "/base64urlnopad") {
+ set resp.http.badpad = blob.encode(IDENTITY,
+ blob.decode(BASE64URLNOPAD, "TWFu" + req.http.foo));
+ }
}
}
diff --git a/bin/varnishtest/tests/m00038.vtc b/bin/varnishtest/tests/m00038.vtc
index 99c7d69..f69bd58 100644
--- a/bin/varnishtest/tests/m00038.vtc
+++ b/bin/varnishtest/tests/m00038.vtc
@@ -21,17 +21,17 @@ varnish v1 -vcl {
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"};
set resp.http.dec
- = blob.encode(IDENTITY,
+ = blob.encode(IDENTITY,
blob.decode_n(8, BASE64,
req.http.foobarbazquux));
set resp.http.deceq
- = blob.encode(IDENTITY,
+ = blob.encode(IDENTITY,
blob.decode_n(20, BASE64,
req.http.foobarbazquux));
set resp.http.declong
- = blob.encode(IDENTITY,
+ = blob.encode(IDENTITY,
blob.decode_n(30, BASE64,
req.http.foobarbazquux));
@@ -40,25 +40,25 @@ varnish v1 -vcl {
blob.decode_n(12, BASE64, req.http.pangram));
set resp.http.b64dechobbes =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(24, BASE64, req.http.hobbes));
set resp.http.b64decall =
- blob.encode(HEXLC, blob.decode_n(128, BASE64,
+ blob.encode(HEXLC, blob.decode_n(128, BASE64,
req.http.all));
set resp.http.urldechobbes =
- blob.encode(IDENTITY, blob.decode_n(180, BASE64URL,
+ blob.encode(IDENTITY, blob.decode_n(180, BASE64URL,
req.http.hobbes));
set resp.http.urldecall =
- blob.encode(HEXLC,
+ blob.encode(HEXLC,
blob.decode_n(256, BASE64URL,
req.http.allurl));
set resp.http.nopaddechobbes =
blob.encode(IDENTITY,
- blob.decode_n(500, BASE64URLNOPAD,
+ blob.decode_n(500, BASE64URLNOPAD,
req.http.hobbesnopad));
set resp.http.nopaddecall =
@@ -71,14 +71,14 @@ varnish v1 -vcl {
set resp.http.urlempty =
blob.encode(IDENTITY, blob.decode_n(1, BASE64URL, ""));
set resp.http.nopadempty =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(0, BASE64URLNOPAD, ""));
set resp.http.emptypieces =
blob.encode(IDENTITY,
blob.decode_n(0, BASE64, req.http.unset + "" + req.http.unset
+ "" + req.http.unset + ""));
- set resp.http.decenc
+ set resp.http.decenc
= blob.encode(BASE64,
blob.decode_n(20, BASE64,
req.http.foobarbazquux));
@@ -86,27 +86,27 @@ varnish v1 -vcl {
set resp.http.l = "L";
set resp.http.dec2pieces
= blob.encode(IDENTITY, blob.decode_n(8, BASE64,
- resp.http.l + "0hlbGxvIHdvcmxkLw=="));
+ resp.http.l + "0hlbGxvIHdvcmxkLw=="));
set resp.http.pad = "==";
set resp.http.dec3pieces
= blob.encode(IDENTITY, blob.decode_n(12, BASE64,
- resp.http.l + "0hlbGxvIHdvcmxkLw"
- + resp.http.pad));
+ resp.http.l + "0hlbGxvIHdvcmxkLw"
+ + resp.http.pad));
set resp.http.mid1 = "GxvI";
set resp.http.mid2 = "dvcmx";
set resp.http.dec7pieces
= blob.encode(IDENTITY, blob.decode_n(16, BASE64,
- resp.http.l + "0hlb" + resp.http.mid1
- + "H" + resp.http.mid2 + "kLw"
- + resp.http.pad));
+ resp.http.l + "0hlb" + resp.http.mid1
+ + "H" + resp.http.mid2 + "kLw"
+ + resp.http.pad));
set resp.http.dec7param
= blob.encode(blob=blob.decode_n(encoded=resp.http.l
+ "0hlb" + resp.http.mid1 + "H" + resp.http.mid2
+ "kLw" + resp.http.pad, decoding=BASE64, n=20),
- encoding=IDENTITY);
+ encoding=IDENTITY);
set resp.http.decnopad = blob.encode(IDENTITY,
blob.decode_n(18, BASE64URLNOPAD,
@@ -114,17 +114,17 @@ varnish v1 -vcl {
set resp.http.decnopad2pieces
= blob.encode(IDENTITY, blob.decode_n(19, BASE64URLNOPAD,
- resp.http.l + "0hlbGxvIHdvcmxkLw"));
+ resp.http.l + "0hlbGxvIHdvcmxkLw"));
set resp.http.decnopad6pieces
= blob.encode(IDENTITY, blob.decode_n(18, BASE64URLNOPAD,
- resp.http.l + "0hlb" + resp.http.mid1
- + "H" + resp.http.mid2 + "kLw"));
+ resp.http.l + "0hlb" + resp.http.mid1
+ + "H" + resp.http.mid2 + "kLw"));
set resp.http.decnopadlong
= blob.encode(IDENTITY,
blob.decode_n(60, BASE64URLNOPAD,
- "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw"
+ "VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZw"
));
}
@@ -169,20 +169,20 @@ varnish v1 -vcl+backend {
import blob;
sub vcl_deliver {
- set req.http.foo = "AAA=";
- if (req.url == "/base64") {
- set resp.http.bad64 = blob.encode(IDENTITY,
- blob.decode_n(8, BASE64, "-_-_" + req.http.foo));
- }
- elsif (req.url == "/base64url") {
- set resp.http.badurl = blob.encode(IDENTITY,
- blob.decode_n(8, BASE64URL, "+/+/" + req.http.foo));
- }
- elsif (req.url == "/base64urlnopad") {
- set resp.http.badpad = blob.encode(IDENTITY,
- blob.decode_n(8, BASE64URLNOPAD,
+ set req.http.foo = "AAA=";
+ if (req.url == "/base64") {
+ set resp.http.bad64 = blob.encode(IDENTITY,
+ blob.decode_n(8, BASE64, "-_-_" + req.http.foo));
+ }
+ elsif (req.url == "/base64url") {
+ set resp.http.badurl = blob.encode(IDENTITY,
+ blob.decode_n(8, BASE64URL, "+/+/" + req.http.foo));
+ }
+ elsif (req.url == "/base64urlnopad") {
+ set resp.http.badpad = blob.encode(IDENTITY,
+ blob.decode_n(8, BASE64URLNOPAD,
"TWFu" + req.http.foo));
- }
+ }
}
}
diff --git a/bin/varnishtest/tests/m00039.vtc b/bin/varnishtest/tests/m00039.vtc
index f5d4809..77fb240 100644
--- a/bin/varnishtest/tests/m00039.vtc
+++ b/bin/varnishtest/tests/m00039.vtc
@@ -22,48 +22,48 @@ varnish v1 -vcl {
{"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="};
set resp.http.urllc =
- blob.encode(URLLC,
+ blob.encode(URLLC,
blob.decode(IDENTITY, req.http.pangram));
set resp.http.urluc =
- blob.encode(URLUC,
+ blob.encode(URLUC,
blob.decode(IDENTITY, req.http.pangram));
- set resp.http.hobbeslc =
+ set resp.http.hobbeslc =
blob.encode(URLLC, blob.decode(IDENTITY, req.http.hobbes));
set resp.http.hobbesuc =
blob.encode(URLUC, blob.decode(IDENTITY, req.http.hobbes));
- set resp.http.umlautslc =
+ set resp.http.umlautslc =
blob.encode(URLLC,
- blob.decode(IDENTITY, req.http.umlauts));
+ blob.decode(IDENTITY, req.http.umlauts));
- set resp.http.umlautsuc =
+ set resp.http.umlautsuc =
blob.encode(URLUC,
- blob.decode(IDENTITY, req.http.umlauts));
+ blob.decode(IDENTITY, req.http.umlauts));
- set resp.http.phklc =
+ set resp.http.phklc =
blob.encode(URLLC,
- blob.decode(IDENTITY, req.http.phkspeak));
+ blob.decode(IDENTITY, req.http.phkspeak));
- set resp.http.phkuc =
+ set resp.http.phkuc =
blob.encode(URLUC,
- blob.decode(IDENTITY, req.http.phkspeak));
+ blob.decode(IDENTITY, req.http.phkspeak));
- set resp.http.utf8lc =
+ set resp.http.utf8lc =
blob.encode(URLLC, blob.decode(IDENTITY, req.http.utf8));
- set resp.http.utf8uc =
+ set resp.http.utf8uc =
blob.encode(URLUC, blob.decode(IDENTITY, req.http.utf8));
- set resp.http.all-lc =
+ set resp.http.all-lc =
blob.encode(URLLC, blob.decode(BASE64, req.http.b64all));
set resp.http.all-uc =
blob.encode(URLUC, blob.decode(BASE64, req.http.b64all));
- set resp.http.empty-lc =
+ set resp.http.empty-lc =
blob.encode(URLLC, blob.decode(IDENTITY, ""));
set resp.http.empty-uc =
@@ -80,7 +80,7 @@ varnish v1 -vcl {
set req.http.urllcfoobar = "foo%3abar%3abaz%3aquux";
set req.http.urlucfoobar = "foo%3Abar%3Abaz%3Aquux";
set req.http.urlmixedfoobar = "foo%3Abar%3abaz%3Aquux";
- set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
+ set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
set req.http.urlhobbesuc = "Man%20is%20distinguished%2C%20not%20only%20by%20his%20reason%2C%20but%20by%20this%20singular%20passion%20from%20other%20animals%2C%20which%20is%20a%20lust%20of%20the%20mind%2C%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2C%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
set req.http.urllcumlauts = "%c3%9cbergr%c3%b6%c3%9fentr%c3%a4ger";
set req.http.urlucumlauts = "%C3%9Cbergr%C3%B6%C3%9Fentr%C3%A4ger";
@@ -88,58 +88,58 @@ varnish v1 -vcl {
set req.http.urlucphk = "sm%C3%A5b%C3%B8rnsp%C3%A6dagog";
set req.http.urllcutf8 = "%e6%97%a5%e6%89%bc%e8%aa%9e";
set req.http.urlucutf8 = "%E6%97%A5%E6%89%BC%E8%AA%9E";
- set req.http.urlalluc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
+ set req.http.urlalluc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
set req.http.urlalllc = "%00%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f%20%21%22%23%24%25%26%27%28%29%2a%2b%2c-.%2f0123456789%3a%3b%3c%3d%3e%3f%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5b%5c%5d%5e_%60abcdefghijklmnopqrstuvwxyz%7b%7c%7d~%7f%80%81%82%83%84%85%86%87%88%89%8a%8b%8c%8d%8e%8f%90%91%92%93%94%95%96%97%98%99%9a%9b%9c%9d%9e%9f%a0%a1%a2%a3%a4%a5%a6%a7%a8%a9%aa%ab%ac%ad%ae%af%b0%b1%b2%b3%b4%b5%b6%b7%b8%b9%ba%bb%bc%bd%be%bf%c0%c1%c2%c3%c4%c5%c6%c7%c8%c9%ca%cb%cc%cd%ce%cf%d0%d1%d2%d3%d4%d5%d6%d7%d8%d9%da%db%dc%dd%de%df%e0%e1%e2%e3%e4%e5%e6%e7%e8%e9%ea%eb%ec%ed%ee%ef%f0%f1%f2%f3%f4%f5%f6%f7%f8%f9%fa%fb%fc%fd%fe%ff";
set resp.http.decuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlucfoobar));
set resp.http.declc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urllcfoobar));
set resp.http.decmixed =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlmixedfoobar));
set resp.http.dechobbesuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlhobbesuc));
set resp.http.dechobbeslc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlhobbeslc));
set resp.http.decumlautsuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlucumlauts));
set resp.http.decumlautslc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urllcumlauts));
set resp.http.decphkuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlucphk));
set resp.http.decphklc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urllcphk));
set resp.http.decutf8uc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urlucutf8));
set resp.http.decutf8lc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.urllcutf8));
set resp.http.decalluc =
- blob.encode(BASE64, blob.decode(URL, req.http.urlalluc));
+ blob.encode(BASE64, blob.decode(URL, req.http.urlalluc));
set resp.http.decalllc =
- blob.encode(BASE64, blob.decode(URL, req.http.urlalllc));
+ blob.encode(BASE64, blob.decode(URL, req.http.urlalllc));
set resp.http.decempty =
blob.encode(IDENTITY, blob.decode(URL, ""));
@@ -148,7 +148,7 @@ varnish v1 -vcl {
blob.encode(IDENTITY, blob.decode(URL, "%00"));
set resp.http.decemptypieces =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode(URL, req.http.unset + ""
+ req.http.unset + ""));
@@ -169,7 +169,7 @@ varnish v1 -vcl {
"20bar%20baz%2" + req.http.part2));
set resp.http.decmanypieces =
- blob.encode(IDENTITY, blob.decode(URL, "" + req.http.unset
+ blob.encode(IDENTITY, blob.decode(URL, "" + req.http.unset
+ req.http.part1 + req.http.unset + ""
+ req.http.unset + "" + "20bar%20baz%2"
+ "" + req.http.unset + req.http.part2
@@ -229,22 +229,22 @@ varnish v1 -vcl+backend {
import blob;
sub vcl_deliver {
- if (req.url == "/percent") {
- set resp.http.bad
- = blob.encode(URLUC, blob.decode(URL, "%"));
- }
- elsif (req.url == "/percent-two") {
- set resp.http.bad = blob.encode(URLUC,
- blob.decode(URL, "%2"));
- }
- elsif (req.url == "/percent-q") {
- set resp.http.bad = blob.encode(URLUC,
- blob.decode(URL, "%q"));
- }
- elsif (req.url == "/percent-two-q") {
- set resp.http.bad = blob.encode(URLUC,
+ if (req.url == "/percent") {
+ set resp.http.bad
+ = blob.encode(URLUC, blob.decode(URL, "%"));
+ }
+ elsif (req.url == "/percent-two") {
+ set resp.http.bad = blob.encode(URLUC,
+ blob.decode(URL, "%2"));
+ }
+ elsif (req.url == "/percent-q") {
+ set resp.http.bad = blob.encode(URLUC,
+ blob.decode(URL, "%q"));
+ }
+ elsif (req.url == "/percent-two-q") {
+ set resp.http.bad = blob.encode(URLUC,
blob.decode(URL, "%2q"));
- }
+ }
}
}
@@ -281,8 +281,8 @@ client c1 {
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
- expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%\"$"
- expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%2\"$"
- expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%q\"$"
- expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%2q\"$"
+ expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%\"$"
+ expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%2\"$"
+ expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%q\"$"
+ expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%2q\"$"
} -run
diff --git a/bin/varnishtest/tests/m00040.vtc b/bin/varnishtest/tests/m00040.vtc
index b93a3c5..0ec8842 100644
--- a/bin/varnishtest/tests/m00040.vtc
+++ b/bin/varnishtest/tests/m00040.vtc
@@ -12,7 +12,7 @@ varnish v1 -vcl {
sub vcl_synth {
set req.http.urllcfoobar = "foo%3abar%3abaz%3aquux";
set req.http.urlucfoobar = "foo%3Abar%3Abaz%3Aquux";
- set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
+ set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
set req.http.urlhobbesuc = "Man%20is%20distinguished%2C%20not%20only%20by%20his%20reason%2C%20but%20by%20this%20singular%20passion%20from%20other%20animals%2C%20which%20is%20a%20lust%20of%20the%20mind%2C%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2C%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
set req.http.urllcumlauts = "%c3%9cbergr%c3%b6%c3%9fentr%c3%a4ger";
set req.http.urlucumlauts = "%C3%9Cbergr%C3%B6%C3%9Fentr%C3%A4ger";
@@ -20,57 +20,57 @@ varnish v1 -vcl {
set req.http.urlucphk = "sm%C3%A5b%C3%B8rnsp%C3%A6dagog";
set req.http.urllcutf8 = "%e6%97%a5%e6%89%bc%e8%aa%9e";
set req.http.urlucutf8 = "%E6%97%A5%E6%89%BC%E8%AA%9E";
- set req.http.urlalluc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
+ set req.http.urlalluc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
set req.http.urlalllc = "%00%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f%20%21%22%23%24%25%26%27%28%29%2a%2b%2c-.%2f0123456789%3a%3b%3c%3d%3e%3f%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5b%5c%5d%5e_%60abcdefghijklmnopqrstuvwxyz%7b%7c%7d~%7f%80%81%82%83%84%85%86%87%88%89%8a%8b%8c%8d%8e%8f%90%91%92%93%94%95%96%97%98%99%9a%9b%9c%9d%9e%9f%a0%a1%a2%a3%a4%a5%a6%a7%a8%a9%aa%ab%ac%ad%ae%af%b0%b1%b2%b3%b4%b5%b6%b7%b8%b9%ba%bb%bc%bd%be%bf%c0%c1%c2%c3%c4%c5%c6%c7%c8%c9%ca%cb%cc%cd%ce%cf%d0%d1%d2%d3%d4%d5%d6%d7%d8%d9%da%db%dc%dd%de%df%e0%e1%e2%e3%e4%e5%e6%e7%e8%e9%ea%eb%ec%ed%ee%ef%f0%f1%f2%f3%f4%f5%f6%f7%f8%f9%fa%fb%fc%fd%fe%ff";
set resp.http.decuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(9, URL, req.http.urlucfoobar));
set resp.http.declc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(12, URL, req.http.urllcfoobar));
set resp.http.dechobbesuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(27, URL, req.http.urlhobbesuc));
set resp.http.dechobbeslc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(27, URL, req.http.urlhobbeslc));
set resp.http.decumlautsuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(17, URL,
req.http.urlucumlauts));
set resp.http.decumlautslc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(25, URL,
req.http.urllcumlauts));
set resp.http.decphkuc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(18, URL, req.http.urlucphk));
set resp.http.decphklc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(30, URL, req.http.urllcphk));
set resp.http.decutf8uc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(9, URL, req.http.urlucutf8));
set resp.http.decutf8lc =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(18, URL, req.http.urllcutf8));
set resp.http.decalluc =
- blob.encode(HEXLC,
+ blob.encode(HEXLC,
blob.decode_n(252, URL, req.http.urlalluc));
set resp.http.decalllc =
- blob.encode(HEXUC,
+ blob.encode(HEXUC,
blob.decode_n(252, URL, req.http.urlalllc));
set resp.http.decempty =
@@ -80,7 +80,7 @@ varnish v1 -vcl {
blob.encode(IDENTITY, blob.decode_n(3, URL, "%00"));
set resp.http.decemptypieces =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(1, URL, req.http.unset + ""
+ req.http.unset + ""));
@@ -88,7 +88,7 @@ varnish v1 -vcl {
set resp.http.dec2pieces =
blob.encode(IDENTITY,
blob.decode_n(6, URL, req.http.part1 +
- "20bar%20baz%20quux"));
+ "20bar%20baz%20quux"));
set req.http.part2 = "0quux";
set resp.http.dec3param =
@@ -104,7 +104,7 @@ varnish v1 -vcl {
+ req.http.part2));
set resp.http.decmanypieces =
- blob.encode(IDENTITY,
+ blob.encode(IDENTITY,
blob.decode_n(24, URL, "" + req.http.unset
+ req.http.part1 + req.http.unset + ""
+ req.http.unset + "" + "20bar%20baz%2"
@@ -148,22 +148,22 @@ varnish v1 -vcl+backend {
import blob;
sub vcl_deliver {
- if (req.url == "/percent") {
- set resp.http.bad = blob.encode(URLUC,
- blob.decode_n(1, URL, "%20"));
- }
- elsif (req.url == "/percent-two") {
- set resp.http.bad = blob.encode(URLUC,
- blob.decode_n(2, URL, "%20"));
- }
- elsif (req.url == "/comma") {
- set resp.http.good = blob.encode(IDENTITY,
- blob.decode_n(3, URL, "%2c%q"));
- }
- elsif (req.url == "/colon") {
- set resp.http.good = blob.encode(IDENTITY,
- blob.decode_n(3, URL, "%3a%2q"));
- }
+ if (req.url == "/percent") {
+ set resp.http.bad = blob.encode(URLUC,
+ blob.decode_n(1, URL, "%20"));
+ }
+ elsif (req.url == "/percent-two") {
+ set resp.http.bad = blob.encode(URLUC,
+ blob.decode_n(2, URL, "%20"));
+ }
+ elsif (req.url == "/comma") {
+ set resp.http.good = blob.encode(IDENTITY,
+ blob.decode_n(3, URL, "%2c%q"));
+ }
+ elsif (req.url == "/colon") {
+ set resp.http.good = blob.encode(IDENTITY,
+ blob.decode_n(3, URL, "%3a%2q"));
+ }
}
}
@@ -192,6 +192,6 @@ client c1 {
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
- expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%20\"$"
- expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%20\"$"
+ expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%20\"$"
+ expect * * VCL_Error "^vmod blob error: cannot decode, illegal encoding beginning with \"%20\"$"
} -run
diff --git a/bin/varnishtest/tests/m00041.vtc b/bin/varnishtest/tests/m00041.vtc
index b5cd490..811d814 100644
--- a/bin/varnishtest/tests/m00041.vtc
+++ b/bin/varnishtest/tests/m00041.vtc
@@ -16,7 +16,7 @@ varnish v1 -arg "-p workspace_client=256k" -vcl {
{"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."};
set req.http.hobbesb64 =
{"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="};
- set req.http.hexhobbes = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
+ set req.http.hexhobbes = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
set req.http.hexalldown =
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"};
set req.http.hexallup =
@@ -204,11 +204,11 @@ varnish v1 -vcl {
}
sub vcl_synth {
- set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
+ set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
set req.http.urlhobbesuc = "Man%20is%20distinguished%2C%20not%20only%20by%20his%20reason%2C%20but%20by%20this%20singular%20passion%20from%20other%20animals%2C%20which%20is%20a%20lust%20of%20the%20mind%2C%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2C%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
- set req.http.urlallupuc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
+ set req.http.urlallupuc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
set req.http.urlalluplc = "%00%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f%20%21%22%23%24%25%26%27%28%29%2a%2b%2c-.%2f0123456789%3a%3b%3c%3d%3e%3f%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5b%5c%5d%5e_%60abcdefghijklmnopqrstuvwxyz%7b%7c%7d~%7f%80%81%82%83%84%85%86%87%88%89%8a%8b%8c%8d%8e%8f%90%91%92%93%94%95%96%97%98%99%9a%9b%9c%9d%9e%9f%a0%a1%a2%a3%a4%a5%a6%a7%a8%a9%aa%ab%ac%ad%ae%af%b0%b1%b2%b3%b4%b5%b6%b7%b8%b9%ba%bb%bc%bd%be%bf%c0%c1%c2%c3%c4%c5%c6%c7%c8%c9%ca%cb%cc%cd%ce%cf%d0%d1%d2%d3%d4%d5%d6%d7%d8%d9%da%db%dc%dd%de%df%e0%e1%e2%e3%e4%e5%e6%e7%e8%e9%ea%eb%ec%ed%ee%ef%f0%f1%f2%f3%f4%f5%f6%f7%f8%f9%fa%fb%fc%fd%fe%ff";
- set req.http.urlalldownuc = "%FF%FE%FD%FC%FB%FA%F9%F8%F7%F6%F5%F4%F3%F2%F1%F0%EF%EE%ED%EC%EB%EA%E9%E8%E7%E6%E5%E4%E3%E2%E1%E0%DF%DE%DD%DC%DB%DA%D9%D8%D7%D6%D5%D4%D3%D2%D1%D0%CF%CE%CD%CC%CB%CA%C9%C8%C7%C6%C5%C4%C3%C2%C1%C0%BF%BE%BD%BC%BB%BA%B9%B8%B7%B6%B5%B4%B3%B2%B1%B0%AF%AE%AD%AC%AB%AA%A9%A8%A7%A6%A5%A4%A3%A2%A1%A0%9F%9E%9D%9C%9B%9A%99%98%97%96%95%94%93%92%91%90%8F%8E%8D%8C%8B%8A%89%88%87%86%85%84%83%82%81%80%7F~%7D%7C%7Bzyxwvutsrqponmlkjihgfedcba%60_%5E%5D%5C%5BZYXWVUTSRQPONMLKJIHGFEDCBA%40%3F%3E%3D%3C%3B%3A9876543210%2F.-%2C%2B%2A%29%28%27%26%25%24%23%22%21%20%1F%1E%1D%1C%1B%1A%19%18%17%16%15%14%13%12%11%10%0F%0E%0D%0C%0B%0A%09%08%07%06%05%04%03%02%01%00";
+ set req.http.urlalldownuc = "%FF%FE%FD%FC%FB%FA%F9%F8%F7%F6%F5%F4%F3%F2%F1%F0%EF%EE%ED%EC%EB%EA%E9%E8%E7%E6%E5%E4%E3%E2%E1%E0%DF%DE%DD%DC%DB%DA%D9%D8%D7%D6%D5%D4%D3%D2%D1%D0%CF%CE%CD%CC%CB%CA%C9%C8%C7%C6%C5%C4%C3%C2%C1%C0%BF%BE%BD%BC%BB%BA%B9%B8%B7%B6%B5%B4%B3%B2%B1%B0%AF%AE%AD%AC%AB%AA%A9%A8%A7%A6%A5%A4%A3%A2%A1%A0%9F%9E%9D%9C%9B%9A%99%98%97%96%95%94%93%92%91%90%8F%8E%8D%8C%8B%8A%89%88%87%86%85%84%83%82%81%80%7F~%7D%7C%7Bzyxwvutsrqponmlkjihgfedcba%60_%5E%5D%5C%5BZYXWVUTSRQPONMLKJIHGFEDCBA%40%3F%3E%3D%3C%3B%3A9876543210%2F.-%2C%2B%2A%29%28%27%26%25%24%23%22%21%20%1F%1E%1D%1C%1B%1A%19%18%17%16%15%14%13%12%11%10%0F%0E%0D%0C%0B%0A%09%08%07%06%05%04%03%02%01%00";
set req.http.urlalldownlc = "%ff%fe%fd%fc%fb%fa%f9%f8%f7%f6%f5%f4%f3%f2%f1%f0%ef%ee%ed%ec%eb%ea%e9%e8%e7%e6%e5%e4%e3%e2%e1%e0%df%de%dd%dc%db%da%d9%d8%d7%d6%d5%d4%d3%d2%d1%d0%cf%ce%cd%cc%cb%ca%c9%c8%c7%c6%c5%c4%c3%c2%c1%c0%bf%be%bd%bc%bb%ba%b9%b8%b7%b6%b5%b4%b3%b2%b1%b0%af%ae%ad%ac%ab%aa%a9%a8%a7%a6%a5%a4%a3%a2%a1%a0%9f%9e%9d%9c%9b%9a%99%98%97%96%95%94%93%92%91%90%8f%8e%8d%8c%8b%8a%89%88%87%86%85%84%83%82%81%80%7f~%7d%7c%7bzyxwvutsrqponmlkjihgfedcba%60_%5e%5d%5c%5bZYXWVUTSRQPONMLKJIHGFEDCBA%40%3f%3e%3d%3c%3b%3a9876543210%2f.-%2c%2b%2a%29%28%27%26%25%24%23%22%21%20%1f%1e%1d%1c%1b%1a%19%18%17%16%15%14%13%12%11%10%0f%0e%0d%0c%0b%0a%09%08%07%06%05%04%03%02%01%00";
set resp.http.urluc2id
@@ -318,57 +318,57 @@ varnish v1 -vcl+backend {
import blob;
sub vcl_deliver {
- set req.http.foo = "AAA=";
- if (req.url == "/1") {
- set resp.http.bad
- = blob.transcode(HEX, IDENTITY, "0x123456");
- }
- elsif (req.url == "/2") {
- set resp.http.bad
- = blob.transcode(BASE64, IDENTITY,
+ set req.http.foo = "AAA=";
+ if (req.url == "/1") {
+ set resp.http.bad
+ = blob.transcode(HEX, IDENTITY, "0x123456");
+ }
+ elsif (req.url == "/2") {
+ set resp.http.bad
+ = blob.transcode(BASE64, IDENTITY,
"-_-_" + req.http.foo);
- }
- elsif (req.url == "/3") {
- set resp.http.bad
- = blob.transcode(BASE64URL, IDENTITY,
+ }
+ elsif (req.url == "/3") {
+ set resp.http.bad
+ = blob.transcode(BASE64URL, IDENTITY,
"+/+/" + req.http.foo);
- }
- elsif (req.url == "/4") {
- set resp.http.bad
- = blob.transcode(BASE64URLNOPAD, IDENTITY,
+ }
+ elsif (req.url == "/4") {
+ set resp.http.bad
+ = blob.transcode(BASE64URLNOPAD, IDENTITY,
"TWFu" + req.http.foo);
- }
- elsif (req.url == "/5") {
- set resp.http.bad
- = blob.transcode(BASE64, BASE64,
+ }
+ elsif (req.url == "/5") {
+ set resp.http.bad
+ = blob.transcode(BASE64, BASE64,
"_-_-" + req.http.foo);
- }
- elsif (req.url == "/6") {
- set resp.http.bad
- = blob.transcode(BASE64URL, BASE64URL,
- "/+/+" + req.http.foo);
- }
- elsif (req.url == "/7") {
- set resp.http.bad
- = blob.transcode(BASE64URLNOPAD, BASE64URLNOPAD,
- "Zm9v" + req.http.foo);
- }
- elsif (req.url == "/8") {
- set resp.http.bad
- = blob.transcode(URL, IDENTITY, "%");
- }
- elsif (req.url == "/9") {
- set resp.http.bad
- = blob.transcode(URL, IDENTITY, "%2");
- }
- elsif (req.url == "/10") {
- set resp.http.bad
- = blob.transcode(URL, IDENTITY, "%q");
- }
- elsif (req.url == "/11") {
- set resp.http.bad
- = blob.transcode(URL, IDENTITY, "%2q");
- }
+ }
+ elsif (req.url == "/6") {
+ set resp.http.bad
+ = blob.transcode(BASE64URL, BASE64URL,
+ "/+/+" + req.http.foo);
+ }
+ elsif (req.url == "/7") {
+ set resp.http.bad
+ = blob.transcode(BASE64URLNOPAD, BASE64URLNOPAD,
+ "Zm9v" + req.http.foo);
+ }
+ elsif (req.url == "/8") {
+ set resp.http.bad
+ = blob.transcode(URL, IDENTITY, "%");
+ }
+ elsif (req.url == "/9") {
+ set resp.http.bad
+ = blob.transcode(URL, IDENTITY, "%2");
+ }
+ elsif (req.url == "/10") {
+ set resp.http.bad
+ = blob.transcode(URL, IDENTITY, "%q");
+ }
+ elsif (req.url == "/11") {
+ set resp.http.bad
+ = blob.transcode(URL, IDENTITY, "%2q");
+ }
}
}
@@ -461,15 +461,15 @@ client c1 {
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "0x123456"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "-_-_"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "\+/\+/"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "TWFu"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "_-_-"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "/\+/\+"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "Zm9v"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%2"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%q"$}
- expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%2q"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "0x123456"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "-_-_"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "\+/\+/"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "TWFu"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "_-_-"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "/\+/\+"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "Zm9v"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%2"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%q"$}
+ expect * * VCL_Error {^vmod blob error: cannot decode, illegal encoding beginning with "%2q"$}
} -run
diff --git a/bin/varnishtest/tests/m00042.vtc b/bin/varnishtest/tests/m00042.vtc
index a34f7d0..164846a 100644
--- a/bin/varnishtest/tests/m00042.vtc
+++ b/bin/varnishtest/tests/m00042.vtc
@@ -15,7 +15,7 @@ varnish v1 -vcl {
{"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."};
set req.http.hobbesb64 =
{"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="};
- set req.http.hexhobbes = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
+ set req.http.hexhobbes = "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e";
set req.http.hexalldown =
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"};
set req.http.hexallup =
@@ -25,7 +25,7 @@ varnish v1 -vcl {
set req.http.b64allurl =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"};
- set resp.http.id2id
+ set resp.http.id2id
= blob.transcode_n(5, IDENTITY, IDENTITY, "Hello world");
set resp.http.id2b64
@@ -140,13 +140,13 @@ varnish v1 -vcl {
set resp.http.b64url2b64url =
blob.transcode_n(34, BASE64URL, BASE64URL,
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
- + "ghijklmnopqrstuvwxyz0123456789-_");
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
+ + "ghijklmnopqrstuvwxyz0123456789-_");
set resp.http.b64urlnopad2b64urlnopad =
blob.transcode_n(34, BASE64URLNOPAD, BASE64URLNOPAD,
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
- + "ghijklmnopqrstuvwxyz0123456789-_");
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
+ + "ghijklmnopqrstuvwxyz0123456789-_");
}
} -start
@@ -203,11 +203,11 @@ varnish v1 -vcl {
}
sub vcl_synth {
- set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
+ set req.http.urlhobbeslc = "Man%20is%20distinguished%2c%20not%20only%20by%20his%20reason%2c%20but%20by%20this%20singular%20passion%20from%20other%20animals%2c%20which%20is%20a%20lust%20of%20the%20mind%2c%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2c%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
set req.http.urlhobbesuc = "Man%20is%20distinguished%2C%20not%20only%20by%20his%20reason%2C%20but%20by%20this%20singular%20passion%20from%20other%20animals%2C%20which%20is%20a%20lust%20of%20the%20mind%2C%20that%20by%20a%20perseverance%20of%20delight%20in%20the%20continued%20and%20indefatigable%20generation%20of%20knowledge%2C%20exceeds%20the%20short%20vehemence%20of%20any%20carnal%20pleasure.";
- set req.http.urlallupuc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
+ set req.http.urlallupuc = "%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF";
set req.http.urlalluplc = "%00%01%02%03%04%05%06%07%08%09%0a%0b%0c%0d%0e%0f%10%11%12%13%14%15%16%17%18%19%1a%1b%1c%1d%1e%1f%20%21%22%23%24%25%26%27%28%29%2a%2b%2c-.%2f0123456789%3a%3b%3c%3d%3e%3f%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5b%5c%5d%5e_%60abcdefghijklmnopqrstuvwxyz%7b%7c%7d~%7f%80%81%82%83%84%85%86%87%88%89%8a%8b%8c%8d%8e%8f%90%91%92%93%94%95%96%97%98%99%9a%9b%9c%9d%9e%9f%a0%a1%a2%a3%a4%a5%a6%a7%a8%a9%aa%ab%ac%ad%ae%af%b0%b1%b2%b3%b4%b5%b6%b7%b8%b9%ba%bb%bc%bd%be%bf%c0%c1%c2%c3%c4%c5%c6%c7%c8%c9%ca%cb%cc%cd%ce%cf%d0%d1%d2%d3%d4%d5%d6%d7%d8%d9%da%db%dc%dd%de%df%e0%e1%e2%e3%e4%e5%e6%e7%e8%e9%ea%eb%ec%ed%ee%ef%f0%f1%f2%f3%f4%f5%f6%f7%f8%f9%fa%fb%fc%fd%fe%ff";
- set req.http.urlalldownuc = "%FF%FE%FD%FC%FB%FA%F9%F8%F7%F6%F5%F4%F3%F2%F1%F0%EF%EE%ED%EC%EB%EA%E9%E8%E7%E6%E5%E4%E3%E2%E1%E0%DF%DE%DD%DC%DB%DA%D9%D8%D7%D6%D5%D4%D3%D2%D1%D0%CF%CE%CD%CC%CB%CA%C9%C8%C7%C6%C5%C4%C3%C2%C1%C0%BF%BE%BD%BC%BB%BA%B9%B8%B7%B6%B5%B4%B3%B2%B1%B0%AF%AE%AD%AC%AB%AA%A9%A8%A7%A6%A5%A4%A3%A2%A1%A0%9F%9E%9D%9C%9B%9A%99%98%97%96%95%94%93%92%91%90%8F%8E%8D%8C%8B%8A%89%88%87%86%85%84%83%82%81%80%7F~%7D%7C%7Bzyxwvutsrqponmlkjihgfedcba%60_%5E%5D%5C%5BZYXWVUTSRQPONMLKJIHGFEDCBA%40%3F%3E%3D%3C%3B%3A9876543210%2F.-%2C%2B%2A%29%28%27%26%25%24%23%22%21%20%1F%1E%1D%1C%1B%1A%19%18%17%16%15%14%13%12%11%10%0F%0E%0D%0C%0B%0A%09%08%07%06%05%04%03%02%01%00";
+ set req.http.urlalldownuc = "%FF%FE%FD%FC%FB%FA%F9%F8%F7%F6%F5%F4%F3%F2%F1%F0%EF%EE%ED%EC%EB%EA%E9%E8%E7%E6%E5%E4%E3%E2%E1%E0%DF%DE%DD%DC%DB%DA%D9%D8%D7%D6%D5%D4%D3%D2%D1%D0%CF%CE%CD%CC%CB%CA%C9%C8%C7%C6%C5%C4%C3%C2%C1%C0%BF%BE%BD%BC%BB%BA%B9%B8%B7%B6%B5%B4%B3%B2%B1%B0%AF%AE%AD%AC%AB%AA%A9%A8%A7%A6%A5%A4%A3%A2%A1%A0%9F%9E%9D%9C%9B%9A%99%98%97%96%95%94%93%92%91%90%8F%8E%8D%8C%8B%8A%89%88%87%86%85%84%83%82%81%80%7F~%7D%7C%7Bzyxwvutsrqponmlkjihgfedcba%60_%5E%5D%5C%5BZYXWVUTSRQPONMLKJIHGFEDCBA%40%3F%3E%3D%3C%3B%3A9876543210%2F.-%2C%2B%2A%29%28%27%26%25%24%23%22%21%20%1F%1E%1D%1C%1B%1A%19%18%17%16%15%14%13%12%11%10%0F%0E%0D%0C%0B%0A%09%08%07%06%05%04%03%02%01%00";
set req.http.urlalldownlc = "%ff%fe%fd%fc%fb%fa%f9%f8%f7%f6%f5%f4%f3%f2%f1%f0%ef%ee%ed%ec%eb%ea%e9%e8%e7%e6%e5%e4%e3%e2%e1%e0%df%de%dd%dc%db%da%d9%d8%d7%d6%d5%d4%d3%d2%d1%d0%cf%ce%cd%cc%cb%ca%c9%c8%c7%c6%c5%c4%c3%c2%c1%c0%bf%be%bd%bc%bb%ba%b9%b8%b7%b6%b5%b4%b3%b2%b1%b0%af%ae%ad%ac%ab%aa%a9%a8%a7%a6%a5%a4%a3%a2%a1%a0%9f%9e%9d%9c%9b%9a%99%98%97%96%95%94%93%92%91%90%8f%8e%8d%8c%8b%8a%89%88%87%86%85%84%83%82%81%80%7f~%7d%7c%7bzyxwvutsrqponmlkjihgfedcba%60_%5e%5d%5c%5bZYXWVUTSRQPONMLKJIHGFEDCBA%40%3f%3e%3d%3c%3b%3a9876543210%2f.-%2c%2b%2a%29%28%27%26%25%24%23%22%21%20%1f%1e%1d%1c%1b%1a%19%18%17%16%15%14%13%12%11%10%0f%0e%0d%0c%0b%0a%09%08%07%06%05%04%03%02%01%00";
set resp.http.urluc2id
@@ -321,59 +321,59 @@ varnish v1 -vcl+backend {
import blob;
sub vcl_deliver {
- set req.http.foo = "AAA=";
- if (req.url == "/1") {
- set resp.http.good
- = blob.transcode_n(3, URL, IDENTITY, "%2c%q");
- }
- elsif (req.url == "/2") {
- set resp.http.good
- = blob.transcode_n(3, URL, IDENTITY, "%3a%2q");
- }
- elsif (req.url == "/3") {
- set resp.http.bad
- = blob.transcode_n(8, HEX, IDENTITY,
- "0x123456");
- }
- elsif (req.url == "/4") {
- set resp.http.bad
- = blob.transcode_n(4, BASE64, IDENTITY,
- "-_-_" + req.http.foo);
- }
- elsif (req.url == "/5") {
- set resp.http.bad
- = blob.transcode_n(4, BASE64URL, IDENTITY,
- "+/+/" + req.http.foo);
- }
- elsif (req.url == "/6") {
- set resp.http.bad
- = blob.transcode_n(8, BASE64URLNOPAD, IDENTITY,
- "TWFu" + req.http.foo);
- }
- elsif (req.url == "/7") {
- set resp.http.bad
- = blob.transcode_n(4, BASE64, BASE64,
- "_-_-" + req.http.foo);
- }
- elsif (req.url == "/8") {
- set resp.http.bad
- = blob.transcode_n(4, BASE64URL, BASE64URL,
- "/+/+" + req.http.foo);
- }
- elsif (req.url == "/9") {
- set resp.http.bad
- = blob.transcode_n(8, BASE64URLNOPAD,
- BASE64URLNOPAD,
+ set req.http.foo = "AAA=";
+ if (req.url == "/1") {
+ set resp.http.good
+ = blob.transcode_n(3, URL, IDENTITY, "%2c%q");
+ }
+ elsif (req.url == "/2") {
+ set resp.http.good
+ = blob.transcode_n(3, URL, IDENTITY, "%3a%2q");
+ }
+ elsif (req.url == "/3") {
+ set resp.http.bad
+ = blob.transcode_n(8, HEX, IDENTITY,
+ "0x123456");
+ }
+ elsif (req.url == "/4") {
+ set resp.http.bad
+ = blob.transcode_n(4, BASE64, IDENTITY,
+ "-_-_" + req.http.foo);
+ }
+ elsif (req.url == "/5") {
+ set resp.http.bad
+ = blob.transcode_n(4, BASE64URL, IDENTITY,
+ "+/+/" + req.http.foo);
+ }
+ elsif (req.url == "/6") {
+ set resp.http.bad
+ = blob.transcode_n(8, BASE64URLNOPAD, IDENTITY,
+ "TWFu" + req.http.foo);
+ }
+ elsif (req.url == "/7") {
+ set resp.http.bad
+ = blob.transcode_n(4, BASE64, BASE64,
+ "_-_-" + req.http.foo);
+ }
+ elsif (req.url == "/8") {
+ set resp.http.bad
+ = blob.transcode_n(4, BASE64URL, BASE64URL,
+ "/+/+" + req.http.foo);
+ }
+ elsif (req.url == "/9") {
+ set resp.http.bad
+ = blob.transcode_n(8, BASE64URLNOPAD,
+ BASE64URLNOPAD,
"Zm9v" + req.http.foo);
- }
- elsif (req.url == "/10") {
- set resp.http.bad
- = blob.transcode_n(1, URL, IDENTITY, "%20");
- }
- elsif (req.url == "/11") {
- set resp.http.bad
- = blob.transcode_n(2, URL, IDENTITY, "%20");
- }
+ }
+ elsif (req.url == "/10") {
+ set resp.http.bad
+ = blob.transcode_n(1, URL, IDENTITY, "%20");
+ }
+ elsif (req.url == "/11") {
+ set resp.http.bad
+ = blob.transcode_n(2, URL, IDENTITY, "%20");
+ }
}
}
diff --git a/bin/varnishtest/tests/m00043.vtc b/bin/varnishtest/tests/m00043.vtc
index c12ac14..74763b5 100644
--- a/bin/varnishtest/tests/m00043.vtc
+++ b/bin/varnishtest/tests/m00043.vtc
@@ -10,7 +10,7 @@ varnish v1 -arg "-i serverid" -vcl+backend {
"The quick brown fox jumps over the lazy dog");
new idpieces
= blob.blob(IDENTITY, "" + server.identity + " "
- + server.identity + "");
+ + server.identity + "");
new idempty = blob.blob(IDENTITY, "");
new idparam
= blob.blob(encoded="" + server.identity + " " + server.identity
diff --git a/lib/libvmod_blob/vmod.vcc b/lib/libvmod_blob/vmod.vcc
index e1319a3..aa88db4 100644
--- a/lib/libvmod_blob/vmod.vcc
+++ b/lib/libvmod_blob/vmod.vcc
@@ -15,9 +15,9 @@ $Module blob 3 utilities for the VCL blob type
BLOB blob.decode(ENUM decoding, STRING_LIST encoded)
BLOB blob.decode_n(INT n, ENUM decoding, STRING_LIST encoded)
STRING blob.transcode(ENUM decoding, ENUM encoding,
- STRING_LIST encoded)
+ STRING_LIST encoded)
STRING blob.transcode_n(INT n, ENUM decoding, ENUM encoding,
- STRING_LIST encoded)
+ STRING_LIST encoded)
# other utilities
BOOL blob.same(BLOB, BLOB)
@@ -47,7 +47,7 @@ Examples::
sub vcl_deliver {
# The .get() method retrieves the BLOB from an object.
set resp.http.MyBlob-As-Hex
- = blob.encode(blob=myblob.get(), encoding=HEXLC);
+ = blob.encode(blob=myblob.get(), encoding=HEXLC);
# The .encode() method efficiently retrieves an encoding.
set resp.http.YourBlob-As-Base64 = yourblob.encode(BASE64);
@@ -55,22 +55,22 @@ Examples::
# decode() and encode() functions convert blobs to text and
# vice versa at runtime.
set resp.http.Base64-Encoded
- = blob.encode(BASE64,
- blob.decode(HEX, req.http.Hex-Encoded));
+ = blob.encode(BASE64,
+ blob.decode(HEX, req.http.Hex-Encoded));
}
sub vcl_recv {
# transcode() converts from one encoding to another.
set req.http.Hex-Encoded
- = blob.transcode(decoding=BASE64, encoding=HEXUC,
- encoded="YmF6");
+ = blob.transcode(decoding=BASE64, encoding=HEXUC,
+ encoded="YmF6");
# transcode() from URL to IDENTITY effects a URL decode.
set req.url = blob.transcode(encoded=req.url, decoding=URL);
# transcode() from IDENTITY to URL effects a URL encode.
set req.http.url_urlcoded
- = blob.transcode(encoded=req.url, encoding=URLLC);
+ = blob.transcode(encoded=req.url, encoding=URLLC);
}
ENCODING SCHEMES
@@ -169,7 +169,7 @@ byte. For example::
set resp.http.Second = "def0";
set resp.http.Hex-Decoded
= blob.encode(HEXLC, blob.decode(HEX,
- resp.http.First + resp.http.Second));
+ resp.http.First + resp.http.Second));
URL*
----
@@ -182,7 +182,7 @@ RFC3986, the hexadecimal characters A-F being output in lower- and
uppercase, respectively.
$Function BLOB decode(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
- HEX, URL} decoding="IDENTITY", STRING_LIST encoded)
+ HEX, URL} decoding="IDENTITY", STRING_LIST encoded)
Returns the BLOB derived from the string ``encoded`` according to the
scheme specified by ``decoding``.
@@ -209,7 +209,7 @@ the encoded string. If ``n`` is greater than the length of the string,
then return the same result as ``decode()``.
$Function STRING encode(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
- HEXUC, HEXLC, URLUC, URLLC} encoding="IDENTITY",
+ HEXUC, HEXLC, URLUC, URLLC} encoding="IDENTITY",
BLOB blob)
Returns a string representation of the BLOB ``blob`` as specifed by
@@ -233,10 +233,10 @@ Example::
= blob.encode(blob=blob.decode(encoded="foo"));
$Function STRING transcode(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
- HEX, URL} decoding="IDENTITY",
- ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
- HEXUC, HEXLC, URLUC, URLLC} encoding="IDENTITY",
- STRING_LIST encoded)
+ HEX, URL} decoding="IDENTITY",
+ ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
+ HEXUC, HEXLC, URLUC, URLLC} encoding="IDENTITY",
+ STRING_LIST encoded)
Translates from one encoding to another, by first decoding the string
``encoded`` according to the scheme ``decoding``, and then returning
@@ -264,10 +264,10 @@ Example::
$Function STRING transcode_n(INT n,
ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
- HEX, URL} decoding="IDENTITY",
- ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
- HEXUC, HEXLC, URLUC, URLLC} encoding="IDENTITY",
- STRING_LIST encoded)
+ HEX, URL} decoding="IDENTITY",
+ ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD,
+ HEXUC, HEXLC, URLUC, URLLC} encoding="IDENTITY",
+ STRING_LIST encoded)
Same as ``transcode()``, but only from the first ``n`` characters of
the encoded string.
@@ -305,8 +305,8 @@ if ``offset + length`` requires more bytes than are available in the
BLOB.
$Object blob(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD, HEX,
- URL} decoding="IDENTITY",
- STRING_LIST encoded)
+ URL} decoding="IDENTITY",
+ STRING_LIST encoded)
Creates an object that contains the BLOB derived from the string
``encoded`` according to the scheme ``decoding``.
@@ -337,7 +337,7 @@ Example::
blob.encode(blob=stringblob.get());
$Method STRING .encode(ENUM {IDENTITY, BASE64, BASE64URL, BASE64URLNOPAD, HEXUC,
- HEXLC, URLUC, URLLC} encoding="IDENTITY")
+ HEXLC, URLUC, URLLC} encoding="IDENTITY")
Returns an encoding of BLOB created by the constructor, according to
the scheme ``encoding``.
diff --git a/lib/libvmod_purge/vmod.vcc b/lib/libvmod_purge/vmod.vcc
index 1e9259e..25a9cb8 100644
--- a/lib/libvmod_purge/vmod.vcc
+++ b/lib/libvmod_purge/vmod.vcc
@@ -42,61 +42,61 @@ EXAMPLE
::
sub vcl_recv {
- if (req.method == "PURGE") {
- if (client.ip !~ purge_acl) {
- return (synth(405));
- }
- return (hash);
- }
+ if (req.method == "PURGE") {
+ if (client.ip !~ purge_acl) {
+ return (synth(405));
+ }
+ return (hash);
+ }
}
sub my_purge {
- set req.http.purged = purge.hard();
- if (req.http.purged == "0") {
- return (synth(404));
- }
- else {
- return (synth(200));
- }
+ set req.http.purged = purge.hard();
+ if (req.http.purged == "0") {
+ return (synth(404));
+ }
+ else {
+ return (synth(200));
+ }
}
sub vcl_hit {
- if (req.method == "PURGE") {
- call my_purge;
- }
+ if (req.method == "PURGE") {
+ call my_purge;
+ }
}
sub vcl_miss {
- if (req.method == "PURGE") {
- call my_purge;
- }
+ if (req.method == "PURGE") {
+ call my_purge;
+ }
}
sub vcl_synth {
- if (req.method == "PURGE") {
- if (req.http.purged) {
- set resp.http.purged = req.http.purged;
- }
- return (deliver);
- }
+ if (req.method == "PURGE") {
+ if (req.http.purged) {
+ set resp.http.purged = req.http.purged;
+ }
+ return (deliver);
+ }
}
$Function INT hard()
Description
This is equivalent to ``return(purge)`` but explicitly called from
- ``vcl_hit`` and ``vcl_miss``. It returns the number of purged objects.
+ ``vcl_hit`` and ``vcl_miss``. It returns the number of purged objects.
Example
set req.http.purged = purge.hard();
$Function INT soft(DURATION ttl = 0, DURATION grace = -1, DURATION keep = -1)
Description
- Sets the TTL, grace and keep. By default, TTL is set to 0 with grace
- and keep periods left untouched. Setting a negative value for grace or
- keep periods leaves them untouched. Setting all three parameters to
- 0 is equivalent to a hard purge. It can only be called from ``vcl_hit``
- or ``vcl_miss``. It returns the number of soft-purged objects.
+ Sets the TTL, grace and keep. By default, TTL is set to 0 with grace
+ and keep periods left untouched. Setting a negative value for grace or
+ keep periods leaves them untouched. Setting all three parameters to
+ 0 is equivalent to a hard purge. It can only be called from ``vcl_hit``
+ or ``vcl_miss``. It returns the number of soft-purged objects.
SEE ALSO
========
More information about the varnish-commit
mailing list