varnishtest "VMOD blob test transcode()"

# Some platforms need larger workspaces for this test
varnish v1 -arg "-p workspace_client=256k" -vcl {
	import blob;
	import std;
	backend b None;

	sub vcl_recv {
	  return(synth(200));
	}

	sub vcl_synth {
	    set req.http.foobar = "foo:bar:baz:quux";
	    set req.http.hobbes =
{"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.hexalldown =
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"};
	    set req.http.hexallup =
{"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"};
	    set req.http.b64all =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999++++////"};
	    set req.http.b64allurl =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"};

	  set resp.http.id2id
	    = blob.transcode(encoded="Hello world");

	  set resp.http.id2b64
	    = blob.transcode(encoded=req.http.hobbes, encoding=BASE64);

	  set resp.http.id2b64nopad
	    = blob.transcode(IDENTITY, BASE64URLNOPAD, encoded=req.http.hobbes);

	  set resp.http.id2hex
	    = blob.transcode(IDENTITY, HEX, encoded=req.http.hobbes);

	  set resp.http.id2hexuc
	    = blob.transcode(IDENTITY, HEX, UPPER, encoded=req.http.hobbes);

	  set resp.http.id2hexlc
	    = blob.transcode(IDENTITY, HEX, LOWER, encoded=req.http.hobbes);

	  set resp.http.id2url
	    = blob.transcode(IDENTITY, URL, encoded=req.http.foobar);

	  set resp.http.id2urluc
	    = blob.transcode(IDENTITY, URL, UPPER, encoded=req.http.foobar);

	  set resp.http.id2urllc
	    = blob.transcode(IDENTITY, URL, LOWER, encoded=req.http.foobar);

	  set resp.http.b642id
	    = blob.transcode(BASE64, IDENTITY, encoded=req.http.hobbesb64);

	  set resp.http.hex2id
	    = blob.transcode(HEX, IDENTITY, encoded=req.http.hexhobbes);

	  set resp.http.hexalldown2b64
	    = blob.transcode(HEX, BASE64, encoded=req.http.hexalldown);

	  set resp.http.hexalldown2b64url
	    = blob.transcode(HEX, BASE64URL, encoded=req.http.hexalldown);

	  set resp.http.hexalldown2b64nopad
	    = blob.transcode(HEX, BASE64URLNOPAD, encoded=req.http.hexalldown);

	  set resp.http.hexallup2b64
	    = blob.transcode(HEX, BASE64, encoded=req.http.hexallup);

	  set resp.http.hexallup2b64url
	    = blob.transcode(HEX, BASE64URL, encoded=req.http.hexallup);

	  set resp.http.hexallup2b64nopad
	    = blob.transcode(HEX, BASE64URLNOPAD, encoded=req.http.hexallup);

	  set resp.http.hexalldown2url
	    = blob.transcode(HEX, URL, encoded=req.http.hexalldown);

	  set resp.http.hexalldown2urluc
	    = blob.transcode(HEX, URL, UPPER, encoded=req.http.hexalldown);

	  set resp.http.hexalldown2urllc
	    = blob.transcode(HEX, URL, LOWER, encoded=req.http.hexalldown);

	  set resp.http.hexallup2url
	    = blob.transcode(HEX, URL, encoded=req.http.hexallup);

	  set resp.http.hexallup2urluc
	    = blob.transcode(HEX, URL, UPPER, encoded=req.http.hexallup);

	  set resp.http.hexallup2urllc
	    = blob.transcode(HEX, URL, LOWER, encoded=req.http.hexallup);

	}
} -start

client c1 {
	txreq
	rxresp
	expect resp.http.id2id == "Hello world"
	expect resp.http.id2b64 == "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="
	expect resp.http.id2b64nopad == "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4"
	expect resp.http.id2hex == "4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c6561737572652e"
	expect resp.http.id2hexuc == "4D616E2069732064697374696E677569736865642C206E6F74206F6E6C792062792068697320726561736F6E2C2062757420627920746869732073696E67756C61722070617373696F6E2066726F6D206F7468657220616E696D616C732C2077686963682069732061206C757374206F6620746865206D696E642C20746861742062792061207065727365766572616E6365206F662064656C6967687420696E2074686520636F6E74696E75656420616E6420696E6465666174696761626C652067656E65726174696F6E206F66206B6E6F776C656467652C2065786365656473207468652073686F727420766568656D656E6365206F6620616E79206361726E616C20706C6561737572652E"
	expect resp.http.id2hexlc == resp.http.id2hex
	expect resp.http.id2url == "foo%3abar%3abaz%3aquux"
	expect resp.http.id2urluc == "foo%3Abar%3Abaz%3Aquux"
	expect resp.http.id2urllc == resp.http.id2url
	expect resp.http.b642id == "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."
	expect resp.http.hex2id == "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."
	expect resp.http.hexalldown2b64 == "//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA=="
	expect resp.http.hexalldown2b64url == "__79_Pv6-fj39vX08_Lx8O_u7ezr6uno5-bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL--vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI-OjYyLiomIh4aFhIOCgYB_fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA=="
	expect resp.http.hexalldown2b64nopad == "__79_Pv6-fj39vX08_Lx8O_u7ezr6uno5-bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL--vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI-OjYyLiomIh4aFhIOCgYB_fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA"
	expect resp.http.hexallup2b64 == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="
	expect resp.http.hexallup2b64url == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w=="
	expect resp.http.hexallup2b64nopad == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w"
	expect resp.http.hexalldown2url == "%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"
	expect resp.http.hexalldown2urluc == "%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"
	expect resp.http.hexalldown2urllc == resp.http.hexalldown2url
	expect resp.http.hexallup2url == "%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"
	expect resp.http.hexallup2urluc == "%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"
	expect resp.http.hexallup2urllc == resp.http.hexallup2url
} -run

varnish v1 -vcl {
	import blob;
	import std;
	backend b None;

	sub vcl_recv {
	  return(synth(200));
	}

	sub vcl_synth {
	    set req.http.foobar = "foo:bar:baz:quux";
	    set req.http.hobbes =
{"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.hexalldown =
{"fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0efeeedecebeae9e8e7e6e5e4e3e2e1e0dfdedddcdbdad9d8d7d6d5d4d3d2d1d0cfcecdcccbcac9c8c7c6c5c4c3c2c1c0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0afaeadacabaaa9a8a7a6a5a4a3a2a1a09f9e9d9c9b9a999897969594939291908f8e8d8c8b8a898887868584838281807f7e7d7c7b7a797877767574737271706f6e6d6c6b6a696867666564636261605f5e5d5c5b5a595857565554535251504f4e4d4c4b4a494847464544434241403f3e3d3c3b3a393837363534333231302f2e2d2c2b2a292827262524232221201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100"};
	    set req.http.hexallup =
{"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"};
	    set req.http.b64all =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999++++////"};
	    set req.http.b64allurl =
{"AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZaaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz0000111122223333444455556666777788889999----____"};

	  set resp.http.b64all2hex
	    = blob.transcode(BASE64, HEX, encoded=req.http.b64all);

	  set resp.http.b64all2hexuc
	    = blob.transcode(BASE64, HEX, UPPER, encoded=req.http.b64all);

	  set resp.http.b64all2hexlc
	    = blob.transcode(BASE64, HEX, LOWER, encoded=req.http.b64all);

	  set resp.http.b64allurl2hex
	    = blob.transcode(BASE64URL, HEX, encoded=req.http.b64allurl);

	  set resp.http.b64allurl2hexuc
	    = blob.transcode(BASE64URL, HEX, UPPER, encoded=req.http.b64allurl);

	  set resp.http.b64allurl2hexlc
	    = blob.transcode(BASE64URL, HEX, LOWER, encoded=req.http.b64allurl);

	  set resp.http.b64all2url
	    = blob.transcode(BASE64, URL, encoded=req.http.b64all);

	  set resp.http.b64all2urluc
	    = blob.transcode(BASE64, URL, UPPER, encoded=req.http.b64all);

	  set resp.http.b64all2urllc
	    = blob.transcode(BASE64, URL, LOWER, encoded=req.http.b64all);

	  set resp.http.b64allurl2url
	    = blob.transcode(BASE64URL, URL, encoded=req.http.b64allurl);

	  set resp.http.b64allurl2urluc
	    = blob.transcode(BASE64URL, URL, UPPER, encoded=req.http.b64allurl);

	  set resp.http.b64allurl2urllc
	    = blob.transcode(BASE64URL, URL, LOWER, encoded=req.http.b64allurl);

	  set resp.http.hexuc2hex
	    = blob.transcode(HEX, HEX, encoded="0123456789ABCDEF");

	  set resp.http.hexuc2hexuc
	    = blob.transcode(HEX, HEX, UPPER, encoded="0123456789ABCDEF");

	  set resp.http.hexlc2hexlc
	    = blob.transcode(HEX, HEX, LOWER, encoded="0123456789abcdef");

	  set resp.http.hexlc2hex
	    = blob.transcode(HEX, HEX, encoded="0123456789abcdef");

	  set resp.http.hexuc2hexlc
	    = blob.transcode(HEX, HEX, LOWER, encoded="0123456789ABCDEF");

	  set resp.http.hexlc2hexuc
	    = blob.transcode(HEX, HEX, UPPER, encoded="0123456789abcdef");

	  set resp.http.hexmix2hex
	    = blob.transcode(HEX, HEX, encoded="0123456789ABCdef");

	  set resp.http.hexmix2hexuc
	    = blob.transcode(HEX, HEX, UPPER, encoded="0123456789ABCdef");

	  set resp.http.hexmix2hexlc
	    = blob.transcode(HEX, HEX, LOWER, encoded="0123456789abcDEF");

	  set req.http.hexpart1 = "01234567";
	  set req.http.hexpart2 = "89abcdef";
	  set resp.http.hexparam
	    = blob.transcode(encoded="" + req.http.unset + ""
				 + req.http.unset + "" + req.http.hexpart1
				 + "" + req.http.unset + "" + req.http.unset
				 + req.http.hexpart2, decoding=HEX,
				 encoding=HEX, case=UPPER);

	  set resp.http.b642b64
	    = blob.transcode(BASE64, BASE64, encoded=
				 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
				 + "ghijklmnopqrstuvwxyz0123456789+/");

	  set resp.http.b64url2b64url =
	    blob.transcode(BASE64URL, BASE64URL, encoded=
			       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
			       + "ghijklmnopqrstuvwxyz0123456789-_");

	  set resp.http.b64urlnopad2b64urlnopad =
	    blob.transcode(BASE64URLNOPAD, BASE64URLNOPAD, encoded=
			       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef"
			       + "ghijklmnopqrstuvwxyz0123456789-_");

	}
}

client c1 {
	txreq
	rxresp
	expect resp.http.b64all2hex == "0000000410410820820c30c31041041451451861861c71c720820824924928a28a2cb2cb30c30c34d34d38e38e3cf3cf4104104514514924924d34d35145145555555965965d75d761861865965969a69a6db6db71c71c75d75d79e79e7df7df8208208618618a28a28e38e39249249659659a69a69e79e7a28a28a69a69aaaaaaaebaebb2cb2cb6db6dbaebaebefbefc30c30c71c71cb2cb2cf3cf3d34d34d75d75db6db6df7df7e38e38e79e79ebaebaefbefbf3cf3cf7df7dfbefbeffffff"
	expect resp.http.b64all2hexuc == "0000000410410820820C30C31041041451451861861C71C720820824924928A28A2CB2CB30C30C34D34D38E38E3CF3CF4104104514514924924D34D35145145555555965965D75D761861865965969A69A6DB6DB71C71C75D75D79E79E7DF7DF8208208618618A28A28E38E39249249659659A69A69E79E7A28A28A69A69AAAAAAAEBAEBB2CB2CB6DB6DBAEBAEBEFBEFC30C30C71C71CB2CB2CF3CF3D34D34D75D75DB6DB6DF7DF7E38E38E79E79EBAEBAEFBEFBF3CF3CF7DF7DFBEFBEFFFFFF"
	expect resp.http.b64all2hexlc == resp.http.b64all2hex
	expect resp.http.b64allurl2hex == "0000000410410820820c30c31041041451451861861c71c720820824924928a28a2cb2cb30c30c34d34d38e38e3cf3cf4104104514514924924d34d35145145555555965965d75d761861865965969a69a6db6db71c71c75d75d79e79e7df7df8208208618618a28a28e38e39249249659659a69a69e79e7a28a28a69a69aaaaaaaebaebb2cb2cb6db6dbaebaebefbefc30c30c71c71cb2cb2cf3cf3d34d34d75d75db6db6df7df7e38e38e79e79ebaebaefbefbf3cf3cf7df7dfbefbeffffff"
	expect resp.http.b64allurl2hexuc == "0000000410410820820C30C31041041451451861861C71C720820824924928A28A2CB2CB30C30C34D34D38E38E3CF3CF4104104514514924924D34D35145145555555965965D75D761861865965969A69A6DB6DB71C71C75D75D79E79E7DF7DF8208208618618A28A28E38E39249249659659A69A69E79E7A28A28A69A69AAAAAAAEBAEBB2CB2CB6DB6DBAEBAEBEFBEFC30C30C71C71CB2CB2CF3CF3D34D34D75D75DB6DB6DF7DF7E38E38E79E79EBAEBAEFBEFBF3CF3CF7DF7DFBEFBEFFFFFF"
	expect resp.http.b64allurl2hexlc == resp.http.b64allurl2hex
	expect resp.http.b64all2url == "%00%00%00%04%10A%08%20%82%0c0%c3%10A%04%14QE%18a%86%1cq%c7%20%82%08%24%92I%28%a2%8a%2c%b2%cb0%c3%0c4%d3M8%e3%8e%3c%f3%cfA%04%10E%14QI%24%92M4%d3QE%14UUUYe%96%5du%d7a%86%18e%96Yi%a6%9am%b6%dbq%c7%1cu%d7%5dy%e7%9e%7d%f7%df%82%08%20%86%18a%8a%28%a2%8e8%e3%92I%24%96Ye%9ai%a6%9ey%e7%a2%8a%28%a6%9ai%aa%aa%aa%ae%ba%eb%b2%cb%2c%b6%dbm%ba%eb%ae%be%fb%ef%c3%0c0%c7%1cq%cb%2c%b2%cf%3c%f3%d3M4%d7%5du%dbm%b6%df%7d%f7%e3%8e8%e7%9ey%eb%ae%ba%ef%be%fb%f3%cf%3c%f7%df%7d%fb%ef%be%ff%ff%ff"
	expect resp.http.b64all2urluc == "%00%00%00%04%10A%08%20%82%0C0%C3%10A%04%14QE%18a%86%1Cq%C7%20%82%08%24%92I%28%A2%8A%2C%B2%CB0%C3%0C4%D3M8%E3%8E%3C%F3%CFA%04%10E%14QI%24%92M4%D3QE%14UUUYe%96%5Du%D7a%86%18e%96Yi%A6%9Am%B6%DBq%C7%1Cu%D7%5Dy%E7%9E%7D%F7%DF%82%08%20%86%18a%8A%28%A2%8E8%E3%92I%24%96Ye%9Ai%A6%9Ey%E7%A2%8A%28%A6%9Ai%AA%AA%AA%AE%BA%EB%B2%CB%2C%B6%DBm%BA%EB%AE%BE%FB%EF%C3%0C0%C7%1Cq%CB%2C%B2%CF%3C%F3%D3M4%D7%5Du%DBm%B6%DF%7D%F7%E3%8E8%E7%9Ey%EB%AE%BA%EF%BE%FB%F3%CF%3C%F7%DF%7D%FB%EF%BE%FF%FF%FF"
	expect resp.http.b64all2urllc == resp.http.b64all2url
	expect resp.http.b64allurl2url == "%00%00%00%04%10A%08%20%82%0c0%c3%10A%04%14QE%18a%86%1cq%c7%20%82%08%24%92I%28%a2%8a%2c%b2%cb0%c3%0c4%d3M8%e3%8e%3c%f3%cfA%04%10E%14QI%24%92M4%d3QE%14UUUYe%96%5du%d7a%86%18e%96Yi%a6%9am%b6%dbq%c7%1cu%d7%5dy%e7%9e%7d%f7%df%82%08%20%86%18a%8a%28%a2%8e8%e3%92I%24%96Ye%9ai%a6%9ey%e7%a2%8a%28%a6%9ai%aa%aa%aa%ae%ba%eb%b2%cb%2c%b6%dbm%ba%eb%ae%be%fb%ef%c3%0c0%c7%1cq%cb%2c%b2%cf%3c%f3%d3M4%d7%5du%dbm%b6%df%7d%f7%e3%8e8%e7%9ey%eb%ae%ba%ef%be%fb%f3%cf%3c%f7%df%7d%fb%ef%be%ff%ff%ff"
	expect resp.http.b64allurl2urluc == "%00%00%00%04%10A%08%20%82%0C0%C3%10A%04%14QE%18a%86%1Cq%C7%20%82%08%24%92I%28%A2%8A%2C%B2%CB0%C3%0C4%D3M8%E3%8E%3C%F3%CFA%04%10E%14QI%24%92M4%D3QE%14UUUYe%96%5Du%D7a%86%18e%96Yi%A6%9Am%B6%DBq%C7%1Cu%D7%5Dy%E7%9E%7D%F7%DF%82%08%20%86%18a%8A%28%A2%8E8%E3%92I%24%96Ye%9Ai%A6%9Ey%E7%A2%8A%28%A6%9Ai%AA%AA%AA%AE%BA%EB%B2%CB%2C%B6%DBm%BA%EB%AE%BE%FB%EF%C3%0C0%C7%1Cq%CB%2C%B2%CF%3C%F3%D3M4%D7%5Du%DBm%B6%DF%7D%F7%E3%8E8%E7%9Ey%EB%AE%BA%EF%BE%FB%F3%CF%3C%F7%DF%7D%FB%EF%BE%FF%FF%FF"
	expect resp.http.b64allurl2urllc == resp.http.b64all2urllc
	expect resp.http.hexlc2hex == "0123456789abcdef"
	expect resp.http.hexuc2hexuc == "0123456789ABCDEF"
	expect resp.http.hexlc2hexlc == resp.http.hexlc2hex
	expect resp.http.hexuc2hex == "0123456789abcdef"
	expect resp.http.hexuc2hexlc == resp.http.hexuc2hex
	expect resp.http.hexlc2hexuc == "0123456789ABCDEF"
	expect resp.http.hexmix2hex == "0123456789abcdef"
	expect resp.http.hexmix2hexuc == "0123456789ABCDEF"
	expect resp.http.hexmix2hexlc == resp.http.hexmix2hex
	expect resp.http.hexparam == "0123456789ABCDEF"
	expect resp.http.b642b64 == "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
	expect resp.http.b64url2b64url == "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
	expect resp.http.b64urlnopad2b64urlnopad == "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
} -run

varnish v1 -vcl {
	import blob;
	import std;
	backend b None;

	sub vcl_recv {
	  return(synth(200));
	}

	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.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.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.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
	    = blob.transcode(URL, IDENTITY, encoded=req.http.urlhobbesuc);

	  set resp.http.urllc2id
	    = blob.transcode(URL, IDENTITY, encoded=req.http.urlhobbeslc);

	  set resp.http.urlalldownuc2b64
	    = blob.transcode(URL, BASE64, encoded=req.http.urlalldownuc);

	  set resp.http.urlalldownuc2b64url
	    = blob.transcode(URL, BASE64URL, encoded=req.http.urlalldownuc);

	  set resp.http.urlalldownuc2b64nopad
	    = blob.transcode(URL, BASE64URLNOPAD,
			     encoded=req.http.urlalldownuc);

	  set resp.http.urlalldownlc2b64
	    = blob.transcode(URL, BASE64, encoded=req.http.urlalldownlc);

	  set resp.http.urlalldownlc2b64url
	    = blob.transcode(URL, BASE64URL, encoded=req.http.urlalldownlc);

	  set resp.http.urlalldownlc2b64nopad
	    = blob.transcode(URL, BASE64URLNOPAD,
			     encoded=req.http.urlalldownlc);

	  set resp.http.urlallupuc2b64
	    = blob.transcode(URL, BASE64, encoded=req.http.urlallupuc);

	  set resp.http.urlallupuc2b64url
	    = blob.transcode(URL, BASE64URL, encoded=req.http.urlallupuc);

	  set resp.http.urlallupuc2b64nopad
	    = blob.transcode(URL, BASE64URLNOPAD, encoded=req.http.urlallupuc);

	  set resp.http.urlalluplc2b64
	    = blob.transcode(URL, BASE64, encoded=req.http.urlalluplc);

	  set resp.http.urlalluplc2b64url
	    = blob.transcode(URL, BASE64URL, encoded=req.http.urlalluplc);

	  set resp.http.urlalluplc2b64nopad
	    = blob.transcode(URL, BASE64URLNOPAD, encoded=req.http.urlalluplc);

	  set resp.http.urlalldownuc2url
	    = blob.transcode(URL, URL, encoded=req.http.urlalldownuc);

	  set resp.http.urlalldownuc2urllc
	    = blob.transcode(URL, URL, LOWER, encoded=req.http.urlalldownuc);

	  set resp.http.urlalldownuc2urluc
	    = blob.transcode(URL, URL, UPPER, encoded=req.http.urlalldownuc);

	  set resp.http.urlalldownlc2url
	    = blob.transcode(URL, URL, encoded=req.http.urlalldownlc);

	  set resp.http.urlalldownlc2urllc
	    = blob.transcode(URL, URL, LOWER, encoded=req.http.urlalldownlc);

	  set resp.http.urlalldownlc2urluc
	    = blob.transcode(URL, URL, UPPER, encoded=req.http.urlalldownlc);

	  set resp.http.urlallupuc2url
	    = blob.transcode(URL, URL, encoded=req.http.urlallupuc);

	  set resp.http.urlallupuc2urluc
	    = blob.transcode(URL, URL, UPPER, encoded=req.http.urlallupuc);

	  set resp.http.urlallupuc2urllc
	    = blob.transcode(URL, URL, LOWER, encoded=req.http.urlallupuc);

	  set resp.http.urlalluplc2url
	    = blob.transcode(URL, URL, encoded=req.http.urlalluplc);

	  set resp.http.urlalluplc2urluc
	    = blob.transcode(URL, URL, UPPER, encoded=req.http.urlalluplc);

	  set resp.http.urlalluplc2urllc
	    = blob.transcode(URL, URL, LOWER, encoded=req.http.urlalluplc);

	  }
}

client c1 {
	txreq
	rxresp
	expect resp.http.urluc2id == "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."
	expect resp.http.urllc2id == "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."
	expect resp.http.urlalldownuc2b64 == "//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA=="
	expect resp.http.urlalldownuc2b64url == "__79_Pv6-fj39vX08_Lx8O_u7ezr6uno5-bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL--vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI-OjYyLiomIh4aFhIOCgYB_fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA=="
	expect resp.http.urlalldownuc2b64nopad == "__79_Pv6-fj39vX08_Lx8O_u7ezr6uno5-bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL--vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI-OjYyLiomIh4aFhIOCgYB_fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA"
	expect resp.http.urlalldownlc2b64 == "//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA=="
	expect resp.http.urlalldownlc2b64url == "__79_Pv6-fj39vX08_Lx8O_u7ezr6uno5-bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL--vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI-OjYyLiomIh4aFhIOCgYB_fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA=="
	expect resp.http.urlalldownlc2b64nopad == "__79_Pv6-fj39vX08_Lx8O_u7ezr6uno5-bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL--vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI-OjYyLiomIh4aFhIOCgYB_fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAA"
	expect resp.http.urlallupuc2b64 == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="
	expect resp.http.urlallupuc2b64url == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w=="
	expect resp.http.urlallupuc2b64nopad == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w"
	expect resp.http.urlalluplc2b64 == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="
	expect resp.http.urlalluplc2b64url == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w=="
	expect resp.http.urlalluplc2b64nopad == "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w"
	expect resp.http.urlalldownuc2url == "%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"
	expect resp.http.urlalldownuc2urluc == "%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"
	expect resp.http.urlalldownuc2urllc == resp.http.urlalldownuc2url
	expect resp.http.urlalldownlc2url == "%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"
	expect resp.http.urlalldownlc2urluc == "%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"
	expect resp.http.urlalldownlc2urllc == resp.http.urlalldownlc2url
	expect resp.http.urlallupuc2urluc == "%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"
	expect resp.http.urlalluplc2urluc == "%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"
	expect resp.http.urlallupuc2url == "%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"
	expect resp.http.urlallupuc2urllc == resp.http.urlallupuc2url
	expect resp.http.urlalluplc2url == "%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"
	expect resp.http.urlalluplc2urllc == resp.http.urlalluplc2url
} -run

# Decode failures

server s1 -repeat 11 -keepalive {
	rxreq
	txresp
} -start

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, encoded="0x123456");
		}
		elsif (req.url == "/2") {
			set resp.http.bad
			    = blob.transcode(BASE64, IDENTITY,
					     encoded="-_-_" + req.http.foo);
		}
		elsif (req.url == "/3") {
			set resp.http.bad
			    = blob.transcode(BASE64URL, IDENTITY,
					     encoded="+/+/" + req.http.foo);
		}
		elsif (req.url == "/4") {
			set resp.http.bad
			    = blob.transcode(BASE64URLNOPAD, IDENTITY,
					     encoded="TWFu" + req.http.foo);
		}
		elsif (req.url == "/5") {
			set resp.http.bad
			    = blob.transcode(BASE64, BASE64,
					     encoded="_-_-" + req.http.foo);
		}
		elsif (req.url == "/6") {
			set resp.http.bad
			    = blob.transcode(BASE64URL, BASE64URL,
					     encoded="/+/+" + req.http.foo);
		}
		elsif (req.url == "/7") {
			set resp.http.bad
			    = blob.transcode(BASE64URLNOPAD, BASE64URLNOPAD,
					     encoded="Zm9v" + req.http.foo);
		}
		elsif (req.url == "/8") {
			set resp.http.bad
			    = blob.transcode(URL, IDENTITY, encoded="%");
		}
		elsif (req.url == "/9") {
			set resp.http.bad
			    = blob.transcode(URL, IDENTITY, encoded="%2");
		}
		elsif (req.url == "/10") {
			set resp.http.bad
			    = blob.transcode(URL, IDENTITY, encoded="%q");
		}
		elsif (req.url == "/11") {
			set resp.http.bad
			    = blob.transcode(URL, IDENTITY, encoded="%2q");
		}
	}
}

client c1 {
	txreq -url /1
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /2
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /3
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /4
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /5
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /6
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /7
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /8
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /9
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /10
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -run

client c1 {
	txreq -url /11
	rxresp
	expect resp.status == 503
	expect resp.reason == "VCL failed"
	expect resp.http.bad == <undef>
} -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"$}
} -run
