Excercise tests on actual STRANDS

parent d1e342a8
...@@ -17,11 +17,11 @@ varnish v1 -vcl { ...@@ -17,11 +17,11 @@ varnish v1 -vcl {
sub do_eurutf { sub do_eurutf {
if (req.http.fallback != "") { if (req.http.fallback != "") {
set resp.http.out = eurutf.iconv( set resp.http.out = eurutf.iconv("X" +
blob.transcode(BASE64, encoded=req.http.in), blob.transcode(BASE64, encoded=req.http.in),
fallback=req.http.fallback); fallback=req.http.fallback);
} else { } else {
set resp.http.out = eurutf.iconv( set resp.http.out = eurutf.iconv("X" +
blob.transcode(BASE64, encoded=req.http.in)); blob.transcode(BASE64, encoded=req.http.in));
} }
return (deliver); return (deliver);
...@@ -29,11 +29,11 @@ varnish v1 -vcl { ...@@ -29,11 +29,11 @@ varnish v1 -vcl {
sub do_utfeur { sub do_utfeur {
if (req.http.fallback != "") { if (req.http.fallback != "") {
set resp.http.out = blob.transcode(encoding=URL, set resp.http.out = blob.transcode(encoding=URL,
encoded=utfeur.iconv(req.http.in, encoded=utfeur.iconv("x" + req.http.in + "x",
fallback=req.http.fallback)); fallback=req.http.fallback));
} else { } else {
set resp.http.out = blob.transcode(encoding=URL, set resp.http.out = blob.transcode(encoding=URL,
encoded=utfeur.iconv(req.http.in)); encoded=utfeur.iconv("x" + req.http.in + "x"));
} }
return (deliver); return (deliver);
} }
...@@ -51,11 +51,11 @@ client c1 { ...@@ -51,11 +51,11 @@ client c1 {
txreq -url "/eurutf" -hdr "in: pA==" txreq -url "/eurutf" -hdr "in: pA=="
rxresp rxresp
expect resp.status == 200 expect resp.status == 200
expect resp.http.out == "€" expect resp.http.out == "X€"
txreq -url "/utfeur" -hdr "in: €" txreq -url "/utfeur" -hdr "in: €"
rxresp rxresp
expect resp.http.out == "%a4" expect resp.http.out == "x%a4x"
expect resp.status == 200 expect resp.status == 200
txreq -url "/utfeur" -hdr "fallback: bad" -hdr "in: 🐰" txreq -url "/utfeur" -hdr "fallback: bad" -hdr "in: 🐰"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment